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 351200 at 2011-05-12 19:11:27 on Problem 2316
#include<iostream>
#include<string>
using namespace std; 
int main()
{
    int d[10];
    string str;
    int i;
    cin>>str;
    int len=str.size();
    for(i=0;i<len;++i)
    {
        d[i]=str[i]-48;
    }
    while(cin>>str)
    {
		if(str=="#")
			break ;

        for(i=0;i<len;++i)
        {
            d[i]+=(str[i]-48);
        }
    }
    for(i=0;i<len;++i)
    {
        d[i]%=10;
        cout<<d[i];
    }
    cout<<endl;

    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