結果
| 問題 |
No.256 桁の数字を入れ替え (2)
|
| コンテスト | |
| ユーザー |
yamaken1343
|
| 提出日時 | 2015-11-10 21:57:08 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 314 bytes |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 21,376 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-09-13 14:21:57 |
| 合計ジャッジ時間 | 803 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 1 RE * 2 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
7 | scanf("%s",c);
| ^~~~~~~~~~~~~
ソースコード
#include<stdio.h>
#include<string.h>
int main(void){
char c[10000];
char buf,max= '0';
int i,j,l,m;
scanf("%s",c);
l = strlen(c);
for(i=0;i<2;i++){
for(j=i;j<l;j++){
m = i;
if(max < c[j]){
m = j;
max = c[i];
}
}
buf = c[i];
c[i] = c[m];
c[m] = buf;
}
printf("%s",c);
return 0;
}
yamaken1343