提出 #28736003
ソースコード 拡げる
#include<stdio.h>
int main()
{
char t[11];
int a,b,w;
scanf("%s",&t);
scanf("%d %d",&a,&b);
w=t[a-1];
t[a-1]=t[b-1];
t[b-1]=w;
printf("%s",t);
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - chukodai |
| ユーザ | TCSP |
| 言語 | C (GCC 9.2.1) |
| 得点 | 100 |
| コード長 | 181 Byte |
| 結果 | AC |
| 実行時間 | 5 ms |
| メモリ | 1708 KiB |
コンパイルエラー
./Main.c: In function ‘main’:
./Main.c:6:10: warning: format ‘%s’ expects argument of type ‘char *’, but argument 2 has type ‘char (*)[11]’ [-Wformat=]
6 | scanf("%s",&t);
| ~^ ~~
| | |
| | char (*)[11]
| char *
./Main.c:6:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
6 | scanf("%s",&t);
| ^~~~~~~~~~~~~~
./Main.c:7:2: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
7 | scanf("%d %d",&a,&b);
| ^~~~~~~~~~~~~~~~~~~~
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 100 / 100 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, example0.txt, example1.txt, example2.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 000.txt | AC | 5 ms | 1676 KiB |
| 001.txt | AC | 1 ms | 1568 KiB |
| 002.txt | AC | 2 ms | 1572 KiB |
| 003.txt | AC | 1 ms | 1672 KiB |
| 004.txt | AC | 1 ms | 1684 KiB |
| 005.txt | AC | 2 ms | 1572 KiB |
| 006.txt | AC | 1 ms | 1652 KiB |
| 007.txt | AC | 2 ms | 1680 KiB |
| 008.txt | AC | 1 ms | 1676 KiB |
| 009.txt | AC | 1 ms | 1680 KiB |
| 010.txt | AC | 1 ms | 1656 KiB |
| 011.txt | AC | 1 ms | 1648 KiB |
| 012.txt | AC | 1 ms | 1572 KiB |
| 013.txt | AC | 2 ms | 1672 KiB |
| example0.txt | AC | 1 ms | 1572 KiB |
| example1.txt | AC | 1 ms | 1708 KiB |
| example2.txt | AC | 1 ms | 1676 KiB |