本站遷移

因為我最近租用了網路空間以及網域,
故本站已遷移至新網站~
這邊的資訊已經正在進行搬移的工作~
希望各位可以到新網站去逛XD

New Website:
http://knightzone.org/

搜尋此網誌

2011年1月19日 星期三

[Zerojudge]d143: Q11172: Relational Operators

照題意判斷大小輸出所求即可。

[C](8ms, 246KB)
#include<stdio.h>
int main()
{
int total;
while( scanf( "%d", &total ) != EOF )
{
int a, b;
int i;
for( i = 0 ; i < total ; i++ )
{
scanf( "%d%d", &a, &b );
if( a > b )
printf( ">\n" );
else if( a < b )
printf( "<\n" );
else
printf( "=\n" );
}
}
return 0;
}
view raw UVa11172.c hosted with ❤ by GitHub


[C++](4ms, 686KB)
#include<iostream>
using namespace std;
int main()
{
int total;
while( cin >> total )
{
int a, b;
for( int i = 0 ; i < total ; i++ )
{
cin >> a >> b;
if( a > b )
cout << '>' << endl;
else if( a < b )
cout << '<' << endl;
else
cout << '=' << endl;
}
}
return 0;
}

0 意見:

張貼留言