The expected result is as follows:
1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890 12345678901 123456789012
Below is the startup code that I would use:
import java.util.Scanner; public class Pyramid { public static void main(String[] args) {
The following is my conclusion.
Type in an integer value 15 1 12 123 1234 12345 123456 1234567 12345678 123456789 12345678910 1234567891011 123456789101112 12345678910111213 1234567891011121314 123456789101112131415
I was thinking about how to solve this problem; if I write the operator If if(i > 9){ i = 0; } if(i > 9){ i = 0; } . But will it reset my counter?
How can I complete this task? What am I missing?
source share