Created
October 3, 2021 18:40
-
-
Save archigoodvin07/50b52281d132370740a5934258e401ec 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
// "Triangle" Task | |
class Figure { | |
public static void main(String[] args) { | |
for (int i=0; i<3;i++) { | |
System.out.println(); | |
for(int j=0;j<3;j++){ | |
if(j<=i) { | |
System.out.print("*"); | |
} | |
} | |
} | |
System.out.println(); | |
for (int i=0; i<3;i++) { | |
System.out.println(); | |
for(int j=0;j<3;j++){ | |
if(i<=j) { | |
System.out.print("*"); | |
} else { | |
System.out.print(" "); | |
} | |
} | |
} | |
System.out.println(); | |
for (int i=0; i<3;i++) { | |
System.out.println(); | |
for(int j=0;j<3;j++){ | |
if(i+j>=2) { | |
System.out.print("*"); | |
} else { | |
System.out.print(" "); | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment