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

wa的同学注意了,这题数据有问题,后面有可能有多的空行……

Posted by angeldust at 2012-03-11 11:14:03 on Problem 2316
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <map>
#include <string>
#include <string.h>
#include <queue>
#include <set>
using namespace std;
int a[10],l;
char c;
int main()
{
	while((c=getchar())&&c!='\n') a[l++]=c-'0';
	while((c=getchar())&&c!=-1&&c!='\n')
	//while((c=getchar())!=-1)
	{
		a[0]+=c-'0';
		for(int i=1;i<l;i++)
		{
			c=getchar();
			a[i]+=c-'0';
		}
		getchar();
	}
	for(int i=0;i<l;i++) printf("%d",a[i]%10);
	putchar('\n');
}
换成注释就WA到ORZ

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