0
Could you say me my mistake ? @JAVA@
https://code.sololearn.com/cKL2lyavJN7f/#java where is my mistake ?
8 Réponses
+ 7
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
Scanner a1=new Scanner(System.in);
// Scanner way1=new Scanner(System.in);
// Scanner b1=new Scanner(System.in);
int a_=a1.nextInt();
int b_=a1.nextInt();
String way_=a1.next();
double result=makine(a_,way_,b_);
System.out.print(result);
}
static int makine(int a,String way,int b){
if(way==("*")){ return a*b; }
else if(way.equals("+")){ return a+b; }
else if(way.equals("/")){ return a/b; }
else if(way.equals("-")){ return a-b; }
else{ return 404; }
}
}
0
Thank you 😊
0
Sorry ?
0
😭😭😭😭😭😭😭😭😭😭😭