結果

問題 No.494 yukicoder
ユーザー sasa
提出日時 2025-03-13 16:56:12
言語 C
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 237 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 23,552 KB
実行使用メモリ 7,324 KB
最終ジャッジ日時 2025-03-13 16:56:16
合計ジャッジ時間 2,479 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample RE * 2
other RE * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:12:34: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
   12 |                         printf("%s",*ans);
      |                                 ~^  ~~~~
      |                                  |  |
      |                                  |  int
      |                                  char *
      |                                 %d
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    7 |         scanf("%s",str);
      |         ^~~~~~~~~~~~~~~

ソースコード

diff #

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

int main(){
	char *ans = "yukicoder";
	char *str;
	scanf("%s",str);
	int len = strlen(ans);
	
	while(*str != '\0'){
		if(*ans != *str){
			printf("%s",*ans);
			return 0;
		}
		ans++;
		str++;
	}
}
0