package whowins;
import java.util.Scanner;
public class WhoWins {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String candidate[] = {"Trump","Fiorina","Carson","Sanders"};
String position[] = {"trumpPosition", "fiorinaPosition", "carsonPosition", "sandersPosition"};
double supportTrump, supportFiorina, supportCarson, supportSanders;
Scanner cs = new Scanner(System.in);
System.out.println("What is Trump's support?");
supportTrump = cs.nextDouble();
System.out.println("What is Fiorina's Support?");
supportFiorina = cs.nextDouble();
System.out.println("What is Carson's support?");
supportCarson = cs.nextDouble();
System.out.println("What is Sander's support?");
supportSanders = cs.nextDouble();
if ((supportTrump) > (supportFiorina) && (supportCarson) && (supportSanders) {
position[0] = ("First Place");
}
}
}
我遇到的问题是无法比较用户将提供的双打。
if ((supportTrump) > (supportFiorina) && (supportCarson) && (supportSanders) {
<--------这整行是一个错误,我已经尝试了一切。