結果

問題 No.2314 Backflip
ユーザー 2475057t
提出日時 2024-07-17 11:19:10
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 317 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 28,160 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-07-17 11:19:11
合計ジャッジ時間 858 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

//No.2314 Backflip
#include <stdio.h>

int main(void){
    
    int cnt = 0;
    char s[9];

    scanf("%s", s);

    for(int i = 0; s[i] != '\0'; i++){
        cnt++;
    }

    if(s[cnt - 1] == '0'){
        s[cnt - 1] = '1'; 
    }
    else{
        s[cnt - 1] = '0';
    }

    printf("%s\n", s);

    return 0;
}
0