結果
| 問題 |
No.494 yukicoder
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-13 16:57:27 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 235 bytes |
| コンパイル時間 | 1,231 ms |
| コンパイル使用メモリ | 23,168 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-13 16:57:29 |
| 合計ジャッジ時間 | 1,411 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 7 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:10:19: warning: comparison between pointer and zero character constant [-Wpointer-compare]
10 | while(str != '\0'){
| ^~
main.c:10:15: note: did you mean to dereference the pointer?
10 | while(str != '\0'){
| ^
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s",str);
| ^~~~~~~~~~~~~~~
ソースコード
#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++;
}
}
sasa