結果
| 問題 |
No.729 文字swap
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-17 11:19:36 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 235 bytes |
| コンパイル時間 | 467 ms |
| コンパイル使用メモリ | 24,192 KB |
| 実行使用メモリ | 7,324 KB |
| 最終ジャッジ日時 | 2025-03-17 11:19:37 |
| 合計ジャッジ時間 | 1,481 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:4:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
4 | scanf("%s",str);
| ^~~~~~~~~~~~~~~
main.c:6:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | scanf("%d%d",&element1,&element2);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void){
char str[10];
scanf("%s",str);
int element1,element2;
scanf("%d%d",&element1,&element2);
char tmp = str[element1];
str[element1] = str[element2];
str[element2] = tmp;
printf("%s",str);
}
sasa