코드업 기초 100제(21~30)
1021
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
System.out.print(str);
}
}
1022
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.nextLine();
System.out.print(str);
}
}
1023
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
StringTokenizer st = new StringTokenizer(str, ".");
while(st.hasMoreTokens()){
System.out.println(st.nextToken());
}
}
}
1024
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
int len = str.length();
for(int i=0; i<len; i++){
System.out.println("'" + str.charAt(i) + "'");
}
}
}
1025
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String num = sc.next();
int len = num.length();
for(int i=0; i<len; i++){
int n = (int) ((int)Integer.parseInt(String.valueOf(num.charAt(i)))* Math.pow(10,len-1-i));
System.out.println("[" + n + "]");
}
}
}
1026
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String time = sc.next();
StringTokenizer st = new StringTokenizer(time, ":");
String[] arr = new String[3];
int i=0;
while(st.hasMoreTokens()){
arr[i] = st.nextToken();
i++;
}
System.out.print(Integer.parseInt(arr[1]));
}
}
1027
import java.util.Scanner;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String time = sc.next();
StringTokenizer st = new StringTokenizer(time, ".");
String[] arr = new String[3];
int i=0;
while(st.hasMoreTokens()){
arr[i] = st.nextToken();
i++;
}
System.out.print(arr[2] + "-" + arr[1] + "-" + arr[0]);
}
}
1028
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long num = sc.nextLong();
System.out.print(num);
}
}
1029
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Double num = sc.nextDouble();
System.out.format("%.11f",num);
}
}
1030
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long num = sc.nextLong();
System.out.print(num);
}
}
Author And Source
이 문제에 관하여(코드업 기초 100제(21~30)), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@yeomyuri42/코드업-기초-100제2130저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)