我只会从用户那里获取3个值,因此只有3个可能的答案.您还可以假设用户不会输入0三次,并且如果他们三次输入相同的值则无关紧要.我可以为这些场景创建我自己的东西(我已经拥有).
import java.util.Scanner;
import java.io.*;
import java.util.*;
public class Triangles
{
public static void main (String[]args) throws IOException
{
String a = "You have an";
String b = "triangle";
double l;
Scanner lengthinput = new Scanner(System.in);
double h;
Scanner heightinput = new Scanner(System.in);
double w;
Scanner widthinput = new Scanner(System.in);
System.out.println("Enter the length.");
l = lengthinput.nextDouble();
System.out.println("Enter the height.");
h = heightinput.nextDouble();
System.out.println("Enter the width.");
w = widthinput.nextDouble();
double max = l;
if (w > max) max = w;
if …Run Code Online (Sandbox Code Playgroud) 如果更改变量会发生什么b,或者如果更改会发生什么a.订单与任何事情有什么关系.
我知道,count = count + 1但这两个变量搞砸了我的大脑.
b = 7;
a = 7;
a = b;
a += 1;
Run Code Online (Sandbox Code Playgroud)
怎么了b?