提出 #13973011


ソースコード 拡げる

#include<stdio.h>
int main(void)
{
    int a[10],b=0,c=0,i;
    scanf("%d %d %d",&a[0],&a[1],&a[2]);
    for(i=0;i<3;i++){
        if(a[i]==1){
            b+=1;
        }else{
            c+=1;
        }
    }
    if(b>c){
        printf("1");
    }else{
        printf("2");
    }
}

提出情報

提出日時
問題 A - 3 つの整数 (Three Integers)
ユーザ maasan
言語 C (GCC 5.4.1)
得点 100
コード長 301 Byte
結果 AC
実行時間 1 ms
メモリ 128 KiB

コンパイルエラー

./Main.c: In function ‘main’:
./Main.c:5:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %d %d",&a[0],&a[1],&a[2]);
     ^

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 100 / 100
結果
AC × 2
AC × 8
セット名 テストケース
Sample sample-01.txt, sample-02.txt
All 01-01.txt, 01-02.txt, 01-03.txt, 01-04.txt, 01-05.txt, 01-06.txt, sample-01.txt, sample-02.txt
ケース名 結果 実行時間 メモリ
01-01.txt AC 0 ms 128 KiB
01-02.txt AC 0 ms 128 KiB
01-03.txt AC 1 ms 128 KiB
01-04.txt AC 1 ms 128 KiB
01-05.txt AC 0 ms 128 KiB
01-06.txt AC 1 ms 128 KiB
sample-01.txt AC 1 ms 128 KiB
sample-02.txt AC 0 ms 128 KiB