Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

为什么不对

Posted by guangmingge at 2012-11-04 16:07:46 on Problem 1519
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator