标签:des style blog io ar color os sp java
8 1300 48 2 1 7 0
2504 1000
#include<stdio.h> int num[1000000]; int switcha(int a,int b) { int i,j; int len; len=0; while(b) { num[len]=b%a; len++; b/=a; } for(i=len-1;i>=0;i--) printf("%d",num[i]); printf("\n"); } int main() { int m,a,b; int sum; while(scanf("%d",&m),m) { scanf("%d%d",&a,&b); sum=a+b; if(sum==0) printf("%d\n",0);//单独考虑0,因为取余的时候遇到0会直接跳过 else switcha(m,sum); } return 0; }
标签:des style blog io ar color os sp java
原文地址:http://blog.csdn.net/wangluoershixiong/article/details/41704737