結果
問題 |
No.791 うし数列
|
ユーザー |
|
提出日時 | 2019-04-12 04:36:32 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 285 ms |
コンパイル使用メモリ | 21,248 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 08:28:24 |
合計ジャッジ時間 | 953 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 WA * 1 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%s", N); | ^~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> #include <string.h> int main() { char N[102+1]; scanf("%s", N); if (N[0] == '1') { int i; for (i = 1; N[i] == '3'; i++) ; if (N[i--] == '\0' && i > 1 && i <= 100) { printf("%d\n", i); exit(0); } } printf("-1\n"); }