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 rudyfather at 2008-08-21 20:36:49 on Problem 2602
#include <iostream>
using namespace std;
char a[1000001],b[1000001];
int n,i,q;
int main()
{    
    n=getchar();
    getchar();
    for(i=0;i<n;i++)
    {
        a[i]=getchar();
        getchar();
        b[i]=getchar();
        getchar();
	}
	for(i=n-1;i>-1;i--)
	{		
		a[i]+=b[i]+q-48;
		if(a[i]>57){a[i]-=10;q=1;}
		else q=0;
	}
    cout<<a<<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