だから私はしばらくの間、この問題に取り組もうとしてきました。私が試みた多くのことは失敗しました。すでに持っているものに追加する方法はありますか?
for(int ii = 1, j = 0; j <= copySel ; ii++, j++) {
int check;
int x, y;
// Prompt as follows
System.out.print("Enter value " + ii + ": ");
try {
c = Get();
}
catch (InputMismatchException e) {
input
System.out.println("Invalid input!");
ii--;
}check = c;
x = check; // I want to try to copy this
y = check - 1; // and copy this
min(x , y) // trying to acheive this
System.out.println(check + " " + x + " " + y);
}
整形でごめんなさい。私の画面です。
Basically let us say user puts in 25 for first input. I want x = 25.
Then user inputs -11. I want y = -11.
Compare minimum z = -11.
then x = z = -11;
User input 33. y = 33
annd so on..
だから私は次のようなもので終わった
for(int ii = 1, j = 0; j <= copySel ; ii++, j++) {
int check;
int x = 0, y = 0, z;
// Prompt as follows
System.out.print("Enter value " + ii + ": ");
try {
c = Get();
}
catch (InputMismatchException e) {
System.out.println("Invalid input!");
ii--;
}check = c;
x = check;
z = x;
if (j % 2 == 1)
{
y = check;
Math.min(z, y);
}
System.out.println(check + " " + x + " " + y + " " + z);
}