bug fixes in Lab1
This commit is contained in:
parent
71baf63a21
commit
4fce8c914c
|
@ -21,10 +21,15 @@ public class Lab1 {
|
||||||
int m = scan.nextInt();// Entering m
|
int m = scan.nextInt();// Entering m
|
||||||
scan.close();
|
scan.close();
|
||||||
|
|
||||||
if (a >= n || b >= m || a <= -c && n >= -c || b <= 0 && m >= 0) {
|
if (a <= -c && n >= -c || b <= 0 && m >= 0) {
|
||||||
System.out.println("Error! Division by zero");
|
System.out.println("Error! Division by zero");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if(a > n || b > m){
|
||||||
|
result = 0;
|
||||||
|
System.out.println(result);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (short i = (short) a; i <= n; i++) {
|
for (short i = (short) a; i <= n; i++) {
|
||||||
for (short j = (short) b; j <= m; j++) {
|
for (short j = (short) b; j <= m; j++) {
|
||||||
|
|
Loading…
Reference in New Issue