結果
| 問題 |
No.908 うしたぷにきあくん文字列
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-11 14:39:07 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 379 ms |
| コンパイル使用メモリ | 25,728 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-11 14:39:08 |
| 合計ジャッジ時間 | 1,462 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 9 WA * 9 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
8 | scanf("%s",s);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
void main(void){
char s[1000] = "a";
bool strcheck = true;
scanf("%s",s);
for(int i = 0 ; i < (int)strlen(s);i++){
if(s[i] == ' ' && i % 2 == 0 || s[i] != ' ' && i % 2 != 0){
strcheck = false;
}
}
if(strcheck){
printf("Yes");
}else{
printf("No");
}
}
Maeda