結果

問題 No.434 占い
ユーザー mosmos_21mosmos_21
提出日時 2016-10-15 00:03:59
言語 C90
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 405 bytes
コンパイル時間 792 ms
コンパイル使用メモリ 20,992 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-05-01 23:50:36
合計ジャッジ時間 10,250 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
6,812 KB
testcase_01 AC 0 ms
6,940 KB
testcase_02 AC 1 ms
6,940 KB
testcase_03 AC 1 ms
6,940 KB
testcase_04 AC 1 ms
6,940 KB
testcase_05 AC 1 ms
6,944 KB
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 1 ms
6,944 KB
testcase_08 AC 259 ms
6,940 KB
testcase_09 AC 26 ms
6,940 KB
testcase_10 AC 3 ms
6,944 KB
testcase_11 AC 1 ms
6,940 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 235 ms
6,940 KB
testcase_14 AC 26 ms
6,944 KB
testcase_15 RE -
testcase_16 TLE -
testcase_17 AC 255 ms
6,944 KB
testcase_18 AC 28 ms
6,944 KB
testcase_19 AC 4 ms
6,940 KB
testcase_20 AC 10 ms
6,940 KB
testcase_21 RE -
testcase_22 TLE -
testcase_23 AC 0 ms
6,940 KB
testcase_24 TLE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 102 ms
6,944 KB
testcase_28 AC 73 ms
6,940 KB
testcase_29 AC 9 ms
6,940 KB
testcase_30 AC 8 ms
6,944 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |   scanf("%d", &n);
      |   ^~~~~~~~~~~~~~~
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |     scanf("%s", s);
      |     ^~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
int main(){
  char s[10001];
  int n,i,j,k,t=0;
  scanf("%d", &n);
  for(i=0;i<n;i++){
    scanf("%s", s);
    do{
      j=0;t=0;
      while(s[j+1]!='\0'){
        t=1;
        k = s[j]-'0' + s[j+1]-'0';
        k = k>9 ? k/10 + k%10 : k;
        s[j]= '0' + k;
        j++;
      }
      if(t) s[j]='\0';
    }while(j > 1);
    printf("%s\n",s);
  }
  return 0;
}
0