符号化基礎100題(21-30)
3786 ワード
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);
}
}
1022import 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);
}
}
1023import 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());
}
}
}
1024import 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) + "'");
}
}
}
1025import 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 + "]");
}
}
}
1026import 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]));
}
}
1027import 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]);
}
}
1028import 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);
}
}
1029import 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);
}
}
1030import 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);
}
}
Reference
この問題について(符号化基礎100題(21-30)), 我々は、より多くの情報をここで見つけました https://velog.io/@yeomyuri42/코드업-기초-100제2130テキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol