반응형

1021번 ~ 1022번

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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String word= br.readLine();

		System.out.print(word);
	}
}

 

1023번

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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] result = br.readLine().split("\\.");

		System.out.print(result[0] + "\n" + result[1]);
	}
}

 

1024번

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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String word = br.readLine();

		for (int i = 0; i < word.length(); i++) {
			System.out.println("'" + word.charAt(i) + "'");
		}
	}
}

 

1025번

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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] numbers = br.readLine().split("");

		System.out.println("[" + Integer.parseInt(numbers[0]) * 10000 + "]");
		System.out.println("[" + Integer.parseInt(numbers[1]) * 1000 + "]");
		System.out.println("[" + Integer.parseInt(numbers[2]) * 100 + "]");
		System.out.println("[" + Integer.parseInt(numbers[3]) * 10 + "]");
		System.out.println("[" + Integer.parseInt(numbers[4]) + "]");

	}
}
반응형

+ Recent posts