标签:
#include<stdio.h> #include<string.h> int a[1000]={0}; char s1[1000]; int main() {
int i,l,t,x=0; freopen("gjc.in","r",stdin); freopen("gjc.out","w",stdout); scanf("%d",&t); scanf("%s",s1); l=strlen(s1); for(i=0;i<=l-1;i++) { a[l-i]=s1[i]-‘0‘; } for(i=0;i<=t;i++) { a[i]=a[i]*t; } for(i=0;i<=l-1;i++) { if(a[i]>10) { x=a[i]/10; a[i]=a[i]%10; a[i+1]=a[i+1]+x; } } while(a[l]!=0) { l++; } for(i=l-1;i>=1;i--) { printf("%d",a[i]); } return 0; }
标签:
原文地址:http://www.cnblogs.com/lldsidi/p/5648042.html