Created
November 1, 2023 16:56
-
-
Save ramyo564/93c984d8752aa008a3ae6257b0904530 to your computer and use it in GitHub Desktop.
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
public class Main { | |
public static void main(String[] args) { | |
System.out.println("[구구단 출력]"); | |
int start = 1; | |
while (start < 10) { | |
for (int i = 1; i < 10; i++) { | |
int result = i*start; | |
if (result < 10){ | |
String multiplicationTable = String.format("0%s x 0%s = 0%s", i, start, result); | |
System.out.print(multiplicationTable + " "); | |
}else { | |
String multiplicationTable = String.format("0%s x 0%s = %s", i, start, result); | |
System.out.print(multiplicationTable + " "); | |
} | |
} | |
System.out.println(); | |
start += 1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment