結果

問題 No.1592 Tenkei 90
ユーザー Maeda
提出日時 2025-03-28 13:03:44
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 526 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 25,216 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-28 13:03:46
合計ジャッジ時間 1,268 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%s",str);
      |     ^~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

void main(void){
    char sample[] = "kyoprotenkei90";
    char str[20] = "a";
    scanf("%s",str);
    int changeCount = 0;
    for(int i = 0 ; i < 14 ; i++){
        for(int j = 0 ; j < 14 ; j++ ){
            if(str[i] == sample[j]){
                changeCount ++;
                sample[j] = 'A';
                break;
            }
        }
        if(changeCount != i+1){
            break;
        }
    }
    if(changeCount == 14){
        printf("Yes");
    }else{
        printf("No");
    }
}
0