Created
January 14, 2024 22:37
-
-
Save codingchild2424/ad8b7175ce50d7e6a7edb97cf48f58e3 to your computer and use it in GitHub Desktop.
Week2_1
This file contains hidden or 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.ArrayList; | |
| public class Week2 { | |
| public static void main(String[] args) { | |
| for (int i = 1; i <= 9; i++) { | |
| ArrayList gugudanList = new ArrayList(); | |
| for (int j = 1; j <= 9; j++) { | |
| // result | |
| int result = i * j; | |
| String gugudanLine = String.format("%02d", i) + " X " + String.format("%02d", j) + " = " + String.format("%02d", result) + "\t"; | |
| gugudanList.add(gugudanLine); | |
| } | |
| System.out.println(String.join("\t", gugudanList)); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment