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:帮我看一下哪儿错了?

Posted by septemberdevil at 2005-02-25 12:26:00 on Problem 1657
In Reply To:帮我看一下哪儿错了? Posted by:meryhello at 2005-02-24 22:59:29
输出格式不对,这么改就能过


 #include <iostream>
> #include <string>
> #include <math.h>
> using namespace std;
> 
> int king(int a,int b);
> int queen(int a,int b);
> void main()
> {
> 	char str1[2],str2[2];
> 	int times,a,b;
> 	> 	cin>>times;
> 	for(int i=0;i<times;i++)
> 	{
> 		cin>>str1;
> 		cin>>str2;
> 		a=fabs(str1[0]-str2[0]);
> 		b=fabs(str1[1]-str2[1]);
> 		if((a==0)&&(b==0))
> 			cout<<0<<" "<<0<<" "<<0<<" "<<0;
> 		else
> 		{
> 			if(a>b)
> 				cout<<a<<" ";
> 			else 
> 				cout<<b<<" ";
> 			if((a==b)||(a==0)||(b==0))
> 				cout<<1<<" ";
> 			else
> 				cout<<2<<" ";
> 			if((a==0)||(b==0))
> 				cout<<1<<" ";
> 			else
> 				cout<<2<<" ";
> 			if(a==b)
> 				cout<<1;
> 			else 
> 				if((a-b)%2==0)
> 					cout<<2;
> 				else
> 					cout<<"Inf";
> 		}
> 	 	cout<<endl;
>       } 

> }
> 我已经提交3次,全部退回……郁闷啊……
> 
> 
> 

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