結果
問題 |
No.305 鍵(2)
|
ユーザー |
|
提出日時 | 2016-06-03 17:47:22 |
言語 | C90 (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 24 ms / 2,000 ms |
コード長 | 505 bytes |
コンパイル時間 | 958 ms |
コンパイル使用メモリ | 21,504 KB |
実行使用メモリ | 25,476 KB |
平均クエリ数 | 45.92 |
最終ジャッジ日時 | 2024-07-16 23:55:55 |
合計ジャッジ時間 | 1,636 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 13 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:30:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 30 | scanf("%d %s",&a,b); | ^~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> int main(){ int answer[10]={-1}; int a=0,result=0; char b[10]; int i=0,j; do{ if(a>result){ i++; if (i==10) i=0; result = a; answer[i]++; } else if (a<result){ answer[i]--; i++; if (i==10) i=0; } else{ answer[i]++; } for(j=0;j<10;j++){ printf("%d",answer[j]); } printf("\n"); fflush(stdout); scanf("%d %s",&a,b); }while(a!=10); return 0; }