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

Re:几行代码ac,纪念下

Posted by Muye007 at 2013-09-29 17:50:25 on Problem 1519
In Reply To:几行代码ac,纪念下 Posted by:seedeed at 2011-03-07 23:42:38
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
char a[2000];
int sum,l,i;
int main()
{
    while(scanf("%s",a)&&strcmp(a,"0")!=0)
    {
        sum=0;
        l=strlen(a);
        for(i=0;i<l;i++)
        sum+=a[i]-'0';
        sum=sum%9;
        printf("%d\n",sum);
    }
    return 0;
}
这怎么就会WA了呢?

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