結果
| 問題 |
No.729 文字swap
|
| コンテスト | |
| ユーザー |
fel1_X_925
|
| 提出日時 | 2018-09-16 17:58:57 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 198 bytes |
| コンパイル時間 | 171 ms |
| コンパイル使用メモリ | 22,016 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-18 07:26:06 |
| 合計ジャッジ時間 | 589 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
9 | scanf("%s", c);
| ~~~~~^~~~~~~~~
main.cpp:10:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%d %d", &a, &b);
| ~~~~~^~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void)
{
int a,b;
char c[11];
char d;
scanf("%s", c);
scanf("%d %d", &a, &b);
d = c[a];
c[a] = c[b];
c[b] = d;
printf("%s", c);
}
fel1_X_925