This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println(“文字列を入力してください。”); | |
String str = in.nextLine(); | |
System.out.println(“入力した文字列は ” + str + ” です。”); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println(“単語を2つ入力してください。”); | |
String str1 = in.next(); | |
String str2 = in.next(); | |
System.out.println(“入力した単語1は ” + str1 + ” です。”); | |
System.out.println(“入力した単語2は ” + str2 + ” です。”); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
System.out.println(“整数を2つ入力してください。”); | |
String x = in.nextInt(); | |
String y = in.nextInt(); | |
System.out.println(“入力した整数1は ” + x + ” です。”); | |
System.out.println(“入力した整数2は ” + y + ” です。”); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner in = new Scanner(System.in); | |
String str = new String(); | |
while(in.hasNext()) { | |
String buf = in.nextLine(); | |
str = str + buf; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while(scn.hasNext()) { | |
int a = scn.nextInt(); | |
int b = scn.nextInt(); | |
int ab = a + b; | |
String str = ab + ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.util.Arrays; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
int n = scn.nextInt(); | |
int[] x = new int[3]; | |
for (int i = 0; i < n; i++) { | |
x[0] = scn.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
import java.text.DecimalFormat; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while(scn.hasNext()) { | |
int a = scn.nextInt(); | |
int b = scn.nextInt(); | |
int p = scn.nextInt(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
while(scn.hasNext()) { | |
int a = scn.nextInt(); | |
int b = scn.nextInt(); | |
int big = 0; | |
int small = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
String str = scn.next(); | |
int strl = str.length(); | |
String rstr = new String(); | |
for (int i = 0; i < strl; i++) { | |
char c = str.charAt(strl - i - 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Main { | |
public static void main(String[] args) { | |
Scanner scn = new Scanner(System.in); | |
int n = scn.nextInt(); | |
int debt = 100; | |
for (int i = 0; i < n; i++) { | |
debt = (int)Math.ceil(debt * 1.05); | |
} |
OlderNewer