Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
用的进制转换,贴一个了:#include"stdio.h" #include"string.h" int main() { char a[20]; while(scanf("%s",&a)&&strcmp(a,"0")) { long b; int i,j; char c[20]; strcpy(c,a); for(i=0;i<strlen(a);i++) if((a[i]-'0')>4) a[i]=a[i]-1; b=strtol(a,0,9); printf("%s: %ld\n",c,b); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator