結果

問題 No.8032 Unavailability of Inequality Signs
ユーザー 007p99lupin
提出日時 2018-04-01 23:43:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 705 ms
コンパイル使用メモリ 70,240 KB
最終ジャッジ日時 2025-01-05 09:47:41
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main(int, const char**)’:
main.cpp:9:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    9 |         scanf("%d",&N);
      |         ~~~~~^~~~~~~~~
main.cpp:14:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |                 scanf("%d",&a[i]);
      |                 ~~~~~^~~~~~~~~~~~
main.cpp:15:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |                 scanf("%d",&b[i]);
      |                 ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <algorithm>

int main(int argc, char const* argv[])
{
	int N;
	scanf("%d",&N);
	int a[N],b[N];
	int i=0;
	int ans[N];
	while(i!=N){
		scanf("%d",&a[i]);
		scanf("%d",&b[i]);
		if(a[i]==b[i]){
			ans[i]= 61;
			
		}
		else if((a[i]==std::max(a[i],b[i]))){
			ans[i]= 62;
		}
		else {
			ans[i]= 60;
		}
		i++;
	}
	int j=0;
	while (j!=N) {
		printf("%c\n",ans[j]);
		j++;
	}
	printf("\n");
	return 0;
}
0