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 |
居然是WA 不可能啊!#include<stdio.h> int main(){ long n ; while(1){ int i ; long temp ,temp1; int rest ; scanf("%ld",&n); temp1=temp = n ; if(n == 0 ){ break; } else{ for(i = 0 ; temp > 0 ; i++){ rest = temp % 10 ; temp /=10 ; if(rest>4){ temp++; n -= temp*pow(9,i); } else{ n -= temp*pow(9,i); } } } printf("%ld: %ld\n",temp1,n); } return 0 ; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator