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 00448322 at 2005-05-08 17:09:49 on Problem 2316
#include <iostream.h>

void main()
{
	int i;
	char num[12];
	char add[12];
	int temp;
	cin>>num;
	while(cin)
	{
		cin>>add;
//		if(add[0]=='-')    //自我测试时使用
//			break;
		for(i=0;num[i]!='\0';i++)  //字符数组元素相加
			num[i]=num[i]+add[i]-'0';
		for(i=0;num[i]!='\0';i++)//和大于10时 
		{
			temp=num[i]-'0';
			temp=temp%10;
			num[i]=temp+'0';
		}
	}
	cout<<num;
		
}

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