| ||||||||||
| 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 | |||||||||
最后 的答案要小于10的In Reply To:为什么不对 Posted by:guangmingge at 2012-11-04 16:07:46 > #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;
> }
>
> cout<<j<<endl;
> 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