結果

問題 No.432 占い(Easy)
コンテスト
ユーザー monburan_0401
提出日時 2018-09-22 23:53:08
言語 C(gnu17)
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -std=gnu17 -Wno-error=implicit-function-declaration -Wno-error=implicit-int -Wno-error=incompatible-pointer-types -Wno-error=int-conversion -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 4 ms / 2,000 ms
コード長 749 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 252 ms
コンパイル使用メモリ 38,464 KB
最終ジャッジ日時 2026-02-22 01:52:43
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <stdio.h>
#include <string.h>
int main(void){
    int N;          //  number of values
    int Si;         //  value
    char S[1001];   //  value
    int last;

    scanf("%d",&N);

    for(int i = 0; i < N; i++){
        scanf("%s",S);
        last = strlen(S);
        while(S[1] != 0){
            for(int j = 0; S[j] != 0; j++){
                Si = S[j] + S[j+1] - 96;    //  (int)0 = (char)48 
                if(Si > 9){
                    Si = (Si / 10)+(Si % 10);
                }
                S[j] = Si + 48;             //  (int)0 = (char)48 
            }
            S[last - 1] = 0;
            last--;
            //  check ok
            //  printf("%s\n",S);
        }
        printf("%s\n",S);
    }

    return 0;
}
0