結果
問題 |
No.308 素数は通れません
|
ユーザー |
![]() |
提出日時 | 2015-12-02 13:39:43 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 360 bytes |
コンパイル時間 | 136 ms |
コンパイル使用メモリ | 21,760 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-14 07:51:58 |
合計ジャッジ時間 | 2,510 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 98 WA * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:7:26: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | s[0] = '0'; scanf("%s", s + 1); | ~~~~~^~~~~~~~~~~~~
ソースコード
#include <stdio.h> char s[27]; int a[26] = {0, 0, 0, 0, 3, 0, 5, 0, 7, 7, 7, 0, 11, 0, 13, 7, 7, 0, 8, 0, 19, 19, 7, 0, 23, 23}; int main(void) { s[0] = '0'; scanf("%s", s + 1); int i = 0; while(s[i + 1] != '\0') { i++; } int v, n = (s[i-1] - '0') * 10 + (s[i] - '0'); if(i <= 2 && n <= 25) { v = a[n]; } else { v = 8; } printf("%d\n", v); return 0; }