結果
| 問題 |
No.908 うしたぷにきあくん文字列
|
| コンテスト | |
| ユーザー |
warm4C0
|
| 提出日時 | 2023-05-06 23:56:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 410 bytes |
| コンパイル時間 | 1,240 ms |
| コンパイル使用メモリ | 159,616 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-24 04:04:04 |
| 合計ジャッジ時間 | 1,776 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 6 WA * 12 |
コンパイルメッセージ
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;
cout << i << endl;
break;
}
i++;
}
if (ok) {
puts("Yes");
} else {
puts("No");
}
return 0;
}
warm4C0