Регистрация
5 Ноя 2013
Сообщения
56
Репутация
0
Спасибо
0
Монет
0
У меня выводится число переменной NW(допустим 2), а мне нужно чтобы выводилось само NW
Код:
import java.util.Scanner;
import java.util.regex.Matcher;

public class qq1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int input, x, x1, x2, y, y2, y1, q, N, S, W, E, w, e, r, NW, NE, SW, SE;
x1 = sc.nextInt();
y1 = sc.nextInt();
x2 = sc.nextInt();
y2 = sc.nextInt();
x = sc.nextInt();
y = sc.nextInt();
input = x + y;
N = y2;
W = x1;
E = x2;
S = y1;
NW = x1 + y2;
NE = x2 + y2;
SE = x2 + y1;
SW = x1 + y1;
int[] nums = {N, W, E, S, NW, NE, SE, SW};
int upSearch = input;
int downSearch = input;
while (true) {
for (int num : nums) {
if (num == upSearch || num == downSearch) {
System.out.println(nums[]);
return;
}
}
upSearch++;
downSearch--;
}
}
}
 
Назад
Сверху