結果

問題 No.908 うしたぷにきあくん文字列
ユーザー courange_cou
提出日時 2020-01-17 16:14:57
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 1,430 ms
コンパイル使用メモリ 28,416 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-25 15:52:20
合計ジャッジ時間 995 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 9 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function 'size':
main.c:9:15: warning: comparison between pointer and integer
    9 |       if(s[i] == NULL){
      |               ^~
main.c: In function 'main':
main.c:22:28: warning: comparison between pointer and integer
   22 |       if((i%2 == 1)&&(s[i] != " "))flag = 1;
      |                            ^~

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

/* stdio */
int size(char *s){
   int x;
   for(int i = 0;i < 1000000000;i++){
      if(s[i] == NULL){
         x = i;
         break;
      }
   }
   return x;
}

int main(){
   char s[100];
   int flag = 0;
   scanf("%s",&s);
   for(int i = 0;i < size(s);i++){
      if((i%2 == 1)&&(s[i] != " "))flag = 1;
      if((i%2 == 0)&&(!(s[i] >= 97)&& !(s[i] <= 122)))flag = 1;
   }
   if(flag == 1)printf("No\n");
   else printf("Yes\n");
}
0