結果
| 問題 | 
                            No.908 うしたぷにきあくん文字列
                             | 
                    
| コンテスト | |
| ユーザー | 
                             warm4C0
                         | 
                    
| 提出日時 | 2023-05-06 23:52:43 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 370 bytes | 
| コンパイル時間 | 1,573 ms | 
| コンパイル使用メモリ | 156,884 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-24 04:02:10 | 
| 合計ジャッジ時間 | 1,959 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 WA * 1 | 
| other | AC * 12 WA * 6 | 
コンパイルメッセージ
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') {
		if (((i&1) && str[i] != ' ') ||
			(!(i&1) && !islower(str[i]))) {
			ok = false;
			break;
		}
		i++;
	}
	if (ok) {
		puts("Yes");
	} else {
		puts("No");
	}
	return 0;
}
            
            
            
        
            
warm4C0