Submission #00221
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #include<bits/stdc++.h> using namespace std; int main(){ string s; cin >> s; while (s != "#" ){ int i = 0, j = 0; char a[1000] = {}, b[1000] = {}, c[1000] = {}; bool A = true , B = true , C = true ; sort(s.begin(), s.end()); while ( '0' <= s[i] && s[i] <= '9' ){ a[j] = s[i]; i++; j++; } if (j == 0){ A = false ; } j = 0; while ( 'A' <= s[i] && s[i] <= 'Z' ){ b[j] = s[i]; i++; j++; } if (j == 0){ B = false ; } j = 0; while ( 'a' <= s[i] && s[i] <= 'z' ){ c[j] = s[i]; i++; j++; } if (j == 0){ C = false ; } if (C){ printf ( "%s" , c); } if (B){ printf ( "%s" , b); } if (A){ printf ( "%s" , a); } printf ( "\n" ); cin >> s; } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0005 - クレヨンの並べ替え |
ユーザー名 | ei2207 |
投稿日時 | 2024-03-29 13:42:45 |
言語 | C++ |
状態 | Accepted |
得点 | 20 |
ソースコード長 | 1041 Byte |
最大実行時間 | 28 ms |
最大メモリ使用量 | 704 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 20 / 20 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
A1 | AC | 28 ms | 476 KB |
1
|
A2 | AC | 26 ms | 704 KB |
1
|
A3 | AC | 20 ms | 668 KB |
1
|
A4 | AC | 17 ms | 636 KB |
1
|