結果
問題 |
No.112 ややこしい鶴亀算
|
ユーザー |
![]() |
提出日時 | 2018-02-16 17:27:30 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 281 bytes |
コンパイル時間 | 293 ms |
コンパイル使用メモリ | 22,912 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-11 21:03:40 |
合計ジャッジ時間 | 1,482 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 2 WA * 21 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:11:1: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 11 | scanf("%d",&n); | ^~~~~~~~~~~~~~ main.c:14:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d",&a[i]); | ^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> int main(void) { int n; int a[50]; int i; int z=0,x=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d",&a[i]); if(a[i]==4){ z++; } if(a[i]==2){ x++; } } printf("%d %d\n",x,z); return 0; }