提交时间:2024-08-20 12:35:45

运行 ID: 168638

#include<cstdio> #include<iostream> #include<string> #include<algorithm> using namespace std; const int NR=5010; struct bign { int f[NR],len; string s; void read() { cin>>s; len=s.size(); for(int i=1;i<=len;i++) f[i]=s[len-i]-'0'; } void print() { for(int i=len;i>=1;i--) cout<<f[i]; cout<<endl; } }; bign operator *(bign a,int b) { bign c; c.len=a.len; int t=0; for(int i=1;i<=c.len;i++) { t+=a.f[i]*b; c.f[i]=t%10; t/=10; } while(t>0) { c.f[++c.len]=t%10; t/=10; } return c; } int main() { bign a,c; int b; a.read(); cin>>b; c=a*b; c.print(); return 0; }