結果

問題 No.400 鏡
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-13 01:23:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 848 bytes
コンパイル時間 3,153 ms
コンパイル使用メモリ 76,988 KB
実行使用メモリ 50,452 KB
最終ジャッジ日時 2024-04-28 17:13:51
合計ジャッジ時間 4,659 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
50,188 KB
testcase_01 AC 51 ms
49,980 KB
testcase_02 AC 51 ms
50,248 KB
testcase_03 AC 50 ms
50,332 KB
testcase_04 AC 50 ms
50,272 KB
testcase_05 AC 50 ms
49,948 KB
testcase_06 AC 51 ms
50,228 KB
testcase_07 AC 51 ms
50,348 KB
testcase_08 AC 50 ms
50,072 KB
testcase_09 AC 51 ms
50,452 KB
testcase_10 AC 51 ms
50,116 KB
testcase_11 AC 51 ms
50,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class No400{
	public static void main(String[] args) {
		try{
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			String str = br.readLine();
			mirror(str);
		}
		catch(IOException e){
			e.getStackTrace();
		}
		catch(NumberFormatException e){
			e.getStackTrace();
		}
	}
	
	public static void mirror(String str){
		char[] chn = str.toCharArray();
		for(int i=0; i < str.length()/2; i++){
			char temp = chn[i];
			chn[i] = chn[chn.length-1-i];
			chn[chn.length-1-i] = temp;
		}
		hanten(chn);
		for(char ans:chn){
			System.out.print(ans);
		}
		System.out.println();
	}
	
	public static void hanten(char[] chn){
		for(int i=0; i < chn.length; i++){
			if(chn[i] == '<') chn[i] = '>';
			else chn[i] ='<';
		}
	}
}
0