| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:帮我看一下哪儿错了?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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator