結果
問題 |
No.39 桁の数字を入れ替え
|
ユーザー |
![]() |
提出日時 | 2022-01-11 15:10:02 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 366 bytes |
コンパイル時間 | 2,110 ms |
コンパイル使用メモリ | 190,996 KB |
最終ジャッジ日時 | 2025-01-27 10:25:43 |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; char s[10]; int len; int main(){ cin>>s; len=strlen(s); for(int i=0;i<len;++i){ int p=s[i],q=i; for(int j=i+1;j<len;++j) if(s[j]>p){ p=s[j]; q=j; } if(q!=i) swap(s[i],s[q]); } cout<<s; return 0; }