1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 const int N = 1e5+5; 6 7 char a[N]; 8 9 struct bign{ 10 int d[N]; 11 int len; 12 bign(){ 13 memset(d,0,sizeof(d)); 14 len = 0; 15 } 16 }; 17 18 bign change(char *a){ 19 bign c; 20 int len = strlen(a); 21 c.len = len; 22 for(int i=0; i<len; i++){ 23 c.d[i] = a[len - i - 1] - '0'; 24 } 25 return c; 26 } 27 28 bign multi(bign a,int k){ 29 bign c; 30 int carry = 0; 31 for(int i=0; i<a.len; i++){ 32 int temp = a.d[i] * k + carry; 33 c.d[c.len++] = temp % 10; 34 carry = temp / 10; 35 } 36 while(carry != 0){ 37 c.d[c.len++] = carry % 10; 38 carry /= 10; 39 } 40 return c; 41 } 42 43 void print(bign c){ 44 for(int i=c.len - 1; i>=0; i--){ 45 printf("%d",c.d[i]); 46 } 47 } 48 49 int main(){ 50 int k; 51 scanf("%s%d",a,&k); 52 bign v = change(a); 53 print(multi(v,k)); 54 return 0; 55 }