結果

問題 No.39 桁の数字を入れ替え
ユーザー DialBird
提出日時 2016-11-20 16:20:02
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 255 bytes
コンパイル時間 378 ms
コンパイル使用メモリ 54,708 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-27 09:02:14
合計ジャッジ時間 1,027 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 14 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;

string N;

int main(){
  cin>>N;
  for (int i=0;i<N.length()-1;i++){
    if (N[i] < N[i+1]) {
      int tmp = N[i];
      N[i] = N[i+1];
      N[i+1] = tmp;
      break;
    }
  }
  cout<<atoi(N.c_str())<<endl;
}
0