結果
| 問題 |
No.908 うしたぷにきあくん文字列
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-11 14:51:38 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 400 bytes |
| コンパイル時間 | 322 ms |
| コンパイル使用メモリ | 25,472 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-11 14:51:40 |
| 合計ジャッジ時間 | 1,196 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:5: warning: implicit declaration of function ‘gets’; did you mean ‘fgets’? [-Wimplicit-function-declaration]
8 | gets(s);
| ^~~~
| fgets
/usr/bin/ld: /tmp/cchhiYgI.o: in function `main':
main.c:(.text.startup+0x44): 警告: the `gets' function is dangerous and should not be used.
ソースコード
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
void main(void){
char s[1000] = "a";
bool strcheck = true;
gets(s);
for(int i = 0 ; i < (int)strlen(s);i++){
if(s[i] == ' ' && i % 2 == 0 || s[i] != ' ' && i % 2 != 0){
strcheck = false;
break;
}
}
if(strcheck){
printf("Yes");
}else{
printf("No");
}
}
Maeda