結果
問題 | No.400 鏡 |
ユーザー |
![]() |
提出日時 | 2016-11-14 15:47:25 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 122 ms / 2,000 ms |
コード長 | 773 bytes |
コンパイル時間 | 4,569 ms |
コンパイル使用メモリ | 75,148 KB |
実行使用メモリ | 41,636 KB |
最終ジャッジ日時 | 2024-11-26 01:03:05 |
合計ジャッジ時間 | 6,247 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 8 |
ソースコード
import java.util.*; public class Main_01{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<String> list = new ArrayList<String>(); List ls = new LinkedList(); String str = sc.nextLine(); // list.add(str); for(int i = 0; i < str.length(); i++){ if(str.charAt(i) == ('>')){ list.add(Character.toString('<')); }else if(str.charAt(i) == ('<')){ list.add(Character.toString('>')); // list.add(Character.toString(str.charAt(i))); } } Collections.reverse(list); //要素を逆順にする for(String string:list){ //拡張for文 System.out.print(string); } } }