結果
| 問題 |
No.729 文字swap
|
| コンテスト | |
| ユーザー |
Heropro7
|
| 提出日時 | 2018-09-19 00:06:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 300 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 53,852 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-18 08:10:18 |
| 合計ジャッジ時間 | 3,373 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 11 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:9:16: warning: ‘str’ is used uninitialized [-Wuninitialized]
9 | cin >> str;
| ^~~
ソースコード
#include<iostream>
using namespace std;
void kaeru(char* str,int n,int m);
int main(void){
char* str;
int n,m;
cin >> str;
cin >> n >> m;
kaeru(str,n,m);
cout << str << '\n';
return 0;
}
void kaeru(char* str,int n,int m){
char tmp;
tmp=*(str+n);
*(str+n)=*(str+m);
*(str+m)=tmp;
}
Heropro7