結果

問題 No.547 未知の言語
ユーザー utsumi_pg
提出日時 2017-07-29 17:21:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 22,656 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 02:20:51
合計ジャッジ時間 1,031 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &N);
      |         ~~~~~^~~~~~~~~~
main.cpp:10:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |                 scanf("%s", S[i]);
      |                 ~~~~~^~~~~~~~~~~~
main.cpp:13:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |                 scanf("%s", T[i]);
      |                 ~~~~~^~~~~~~~~~~~

ソースコード

diff #

#include<cstdio>
#include<cstring>

int N;
char S[10][20 + 1], T[10][20 + 1];

int main(){
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		scanf("%s", S[i]);
	}
	for(int i = 0; i < N; i++){
		scanf("%s", T[i]);
	}
	for(int i = 0; i < N; i++){
		if(strcmp(S[i], T[i]) != 0){
			printf("%d\n", i + 1);
			printf("%s\n", S[i]);
			printf("%s\n", T[i]);
		}
	}
	return 0;
}
0