| ||||||||||
| 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 | |||||||||
1657 哪位高人帮忙看一下,运行一下,错在哪里?自己机上可以运行的#include<iostream>
#include<cmath>
using namespace std;
void main()
{
int t,i,j,s[20][2];
cin>>t;
char start[2],end[2];
for(j = 0 ; j < t ; j++)
{
for(i = 0 ; i < 2 ; i++)
cin>>start[i];
for(i = 0 ; i < 2 ; i++)
cin>>end[i];
for( i=0 ; i < 2 ; i++)
{
s[j][i] = abs ((int)start[i] - (int)end[i]);
}
}
for( j=0 ;j < t; j++)
{
if ( s[j][0] >= s[j][1] )
cout<<s[j][0]<<" ";
else
cout<<s[j][1]<<" ";
if ( s[j][0] == 0 || s[j][1] == 0 || s[j][0] == s[j][1] )
cout<< 1 <<" ";
else
cout<< 2 <<" ";
if ( s[j][0] == 0 || s[j][1] == 0 )
cout<< 1 <<" ";
else
cout<< 2 <<" ";
if( s[j][0] == s[j][1] )
cout<< 1 <<" ";
else if ( ( abs (s[j][0] - s[j][1]) ) % 2 ==0 )
cout<< 2 <<" ";
else
cout<<"Inf";
cout<<endl;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator