結果

問題 No.547 未知の言語
ユーザー Bantako
提出日時 2017-07-28 22:23:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 321 bytes
コンパイル時間 1,304 ms
コンパイル使用メモリ 157,772 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-26 02:09:22
合計ジャッジ時間 2,467 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:2:1: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
    2 | main(){
      | ^~~~
main.cpp: In function ‘int main()’:
main.cpp:5:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    5 |     scanf("%d",&N);
      |     ~~~~~^~~~~~~~~
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s",S[i]);
      |         ~~~~~^~~~~~~~~~~
main.cpp:10:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%s",T[i]);
      |         ~~~~~^~~~~~~~~~~

ソースコード

diff #

#include<bits/stdc++.h>
main(){
    int N;
    char S[10][21],T[10][21];
    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]))printf("%d\n%s\n%s\n",i+1,S[i],T[i]);
    }
}
0