Answer the question
In order to leave comments, you need to log in
I can't understand what is the error (math.min(), math.max())?
//help please
import java.lang.Math;
import java.util.Scanner;
public class d {
public static void main(String[] args) {
int an;
Scanner sc = new Scanner(System.in);
System.out.println("vvedite c");
int c = sc.nextInt();
System.out.println("vvedite b");
int b = sc.nextInt();
an= 12 * Math.max(c,b) + Math.min(2*c,b-1);
return;
}
Answer the question
In order to leave comments, you need to log in
It looks like you are not familiar with Java.
The logic is not very clear, but try this code:
import java.util.Scanner;
public class D {
public static void main(String[] args) {
int an;
Scanner sc = new Scanner(System.in);
System.out.println("vvedite c");
int c = sc.nextInt();
System.out.println("vvedite b");
int b = sc.nextInt();
an= 12 * Math.max(c,b) + Math.min(2*c,b-1);
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question