I run my code, and it seems nothing wrong, but I still failed.
It says, "Be sure that you have displayed the correct number of rows." Why?
package com.codegym.task.task04.task0436;
/*
Drawing a rectangle
*/
import java.io.*;
public class Solution {
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(reader.readLine());
int m = Integer.parseInt(reader.readLine());
for (; product8 (n, m);) {
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
System.out.print("8");
}
System.out.println();
}
return;
}
}
public static boolean product8 (int a, int b) {
if (a * b == 8) return true;
else return false;
}
}