結果
| 問題 |
No.597 concat
|
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-10 15:12:03 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 221 bytes |
| コンパイル時間 | 275 ms |
| コンパイル使用メモリ | 25,472 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-10 15:12:07 |
| 合計ジャッジ時間 | 3,045 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:9:25: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘int’ [-Wformat=]
9 | scanf("%s",n);
| ~^ ~
| | |
| | int
| char *
main.c:5:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s",n);
| ^~~~~~~~~~~~~
ソースコード
#include <stdio.h>
#include <string.h>
void main(void){
int n = 0;
scanf("%d",&n);
char str[100] = "a";
char ans[10000] = "a";
for(int i = 0 ; i < n ; i++){
scanf("%s",n);
strcat(ans,str);
}
printf("%s",ans);
}
Maeda