結果

問題 No.201 yukicoderじゃんけん
ユーザー umashikaumashika
提出日時 2016-02-01 19:46:29
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 715 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 21,776 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-21 18:30:23
合計ジャッジ時間 915 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 1 ms
4,348 KB
testcase_13 RE -
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 0 ms
4,348 KB
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 1 ms
4,348 KB
testcase_19 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:31:9: warning: ‘return’ with no value, in function returning non-void
   31 |         return;
      |         ^~~~~~
main.c:3:5: note: declared here
    3 | int main(void)
      |     ^~~~
main.c:35:9: warning: ‘return’ with no value, in function returning non-void
   35 |         return;
      |         ^~~~~~
main.c:3:5: note: declared here
    3 | int main(void)
      |     ^~~~
main.c:15:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |   scanf("%s %s %c",s1,p1,&x1);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
main.c:16:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   16 |   scanf("%s %s %c",s2,p2,&x2);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include<stdio.h>
#include<string.h>
int main(void)
{
  char s1[101];
  char s2[101];
  //整数型では格納しきれない
  //配列を用いる
  char p1[100000];
  char p2[100000];
  int len_p1,len_p2;
  char x1,x2;
  int i;

  scanf("%s %s %c",s1,p1,&x1);
  scanf("%s %s %c",s2,p2,&x2);

  len_p1=strlen(p1);
  len_p2=strlen(p2);

  if(len_p1 > len_p2){
    printf("%s\n",s1);
  }
  else if(len_p1 < len_p2){
    printf("%s\n",s2);
  }
  else{//同じ長さ(桁数)だった時
    for(i=0;i<len_p1;i++){
      if(p1[i]>p2[i]){
        printf("%s",s1);
        return;
      }
      else if(p1[i]<p2[i]){
        printf("%s\n",s2);
        return;
      }
    }
    printf("-1\n");
  }
  return 0;
}



0