結果
問題 |
No.908 うしたぷにきあくん文字列
|
ユーザー |
![]() |
提出日時 | 2023-05-06 23:57:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 388 bytes |
コンパイル時間 | 1,606 ms |
コンパイル使用メモリ | 157,020 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-24 04:04:14 |
合計ジャッジ時間 | 1,884 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:8:14: warning: ignoring return value of ‘char* fgets(char*, int, FILE*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | fgets(str, sizeof(str), stdin); | ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { char str[256]; memset(str, 0, sizeof(str)); fgets(str, sizeof(str), stdin); bool ok = true; int i = 0; while(str[i] != '\0' && str[i] != '\n') { if (((i&1) && str[i] != ' ') || (!(i&1) && !islower(str[i]))) { ok = false; break; } i++; } if (ok) { puts("Yes"); } else { puts("No"); } return 0; }