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<iostream> #include<string> using namespace std; int main(){ string str; cin>>str; while(str!="0"){ int i = str.size(); int j(0); for(int k=0;k<i;k++){ j = (j*10 + (str[k]-'0'))%9; } if(j==0){ j+=9; } cout<<j<<endl; l: cin>>str; } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator