+ 1

What is wrong with my code?

import java.util.Scanner; public class huh{ public static void main(String[] args){ Scanner h = new Scanner(System.in); int tc = h.nextInt(); for(int i = 1; i <= tc; i++){ int r = h.nextInt(); int c = h.nextInt(); System.out.println("Case #"+i+":"); System.out.print(".."); for(int a=r;a>1;a--){ System.out.print("+-"); } System.out.println("+"); System.out.print(".."); for(int b=r;b>1;b--){ System.out.print("|."); } System.out.println("|"); for(int d=r;d>0;d--){ System.out.print("+-"); } System.out.println("+"); for(int e=1; e<c;e++){ for(int f=r;f>0;f--){ System.out.print("|.");} System.out.println("|"); for(int g=r;g>0;g--){ System.out.print("+-");} } } }

2nd Apr 2022, 9:37 PM
Маhmud Salihov
Маhmud Salihov - avatar
3 Answers
+ 2
Add "}" at the end of the code.
2nd Apr 2022, 10:34 PM
Solo
Solo - avatar
+ 1
After I added }, I try input 3 2 2 3 3 6 6 and I got some pattern
4th Apr 2022, 1:50 AM
zemiak
0
Nothing changed
2nd Apr 2022, 10:44 PM
Маhmud Salihov
Маhmud Salihov - avatar