結果

問題 No.400 鏡
ユーザー TwinkleStar74TwinkleStar74
提出日時 2017-10-13 01:23:42
言語 Java21
(openjdk 21)
結果
AC  
実行時間 43 ms / 2,000 ms
コード長 848 bytes
コンパイル時間 3,136 ms
コンパイル使用メモリ 73,928 KB
実行使用メモリ 49,544 KB
最終ジャッジ日時 2023-08-11 00:05:10
合計ジャッジ時間 4,219 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
49,236 KB
testcase_01 AC 41 ms
49,188 KB
testcase_02 AC 42 ms
49,544 KB
testcase_03 AC 43 ms
47,500 KB
testcase_04 AC 41 ms
49,284 KB
testcase_05 AC 39 ms
49,272 KB
testcase_06 AC 42 ms
49,320 KB
testcase_07 AC 43 ms
49,364 KB
testcase_08 AC 42 ms
49,164 KB
testcase_09 AC 43 ms
49,244 KB
testcase_10 AC 42 ms
49,500 KB
testcase_11 AC 41 ms
49,268 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