結果
| 問題 | No.729 文字swap |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-09-07 21:44:28 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 201 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 21,248 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-29 12:09:05 |
| 合計ジャッジ時間 | 728 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%s",S);
| ~~~~~^~~~~~~~
main.cpp:7:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%d %d",&i,&j);
| ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
char S[11];
int i , j;
int main(){
scanf("%s",S);
scanf("%d %d",&i,&j);
char tmp = S[i];
S[i] = S[j];
S[j] = tmp;
printf("%s\n",S);
}