結果
問題 |
No.552 十分簡単な星1の問題
|
ユーザー |
|
提出日時 | 2017-09-03 11:28:13 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 247 bytes |
コンパイル時間 | 118 ms |
コンパイル使用メモリ | 22,272 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-06 19:58:23 |
合計ジャッジ時間 | 7,756 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | RE * 47 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%99s", s); | ~~~~~^~~~~~~~~~~ main.cpp:6:14: warning: ‘s’ is used uninitialized [-Wuninitialized] 6 | scanf("%99s", s); | ~~~~~^~~~~~~~~~~
ソースコード
#include <stdio.h> #include <string.h> int main(void) { char *s; scanf("%99s", s); if (!strcmp(s, "0")) { printf("%d\n", 0); } else { for (int i = 0; s[i] != '\0'; i++) { printf("%c", s[i]); } printf("%d\n", 0); } return 0; }