我写了这段代码,但它似乎不起作用。当我们输入d
时,它会计算美元,但仍然在做(..what?)。
你能看到列表部分中的+检测+,错误的部分吗?
String currency = sc.next();
char detect = currency.charAt(0);
switch (detect){
case 'D':
case 'd':
double dollar = (amount/18*10);
System.out.println(amount + " Turkish Lira(s) --> " + dollar + " Dollar");
case 'E':
case 'e':
double euro = (amount/23*10);
System.out.println(amount + " --> " + euro + " Euro");
case 'T':
case 't':
double lira = (amount);
System.out.println(amount + " --> " + lira+ " Lira(s)");
while (detect!='d'|| detect!='e' || detect!='t' || detect!='D'|| detect!='E' || detect!='T'){
System.out.println("Can u See " + detect + " In The List ?\n" + menucur);
currency = sc.next();
detect = currency.charAt(0);
}
}