Enough Fuel Consumption
Description
You are given the amount of fuel consumed by a car travelling 1 km. You are also provided total distance the car will be travelling. If the total amount of fuel required by car is greater than 50 litres, print "Enough" (without quotes), else print "Go On" (without quotes).
Input
Input Format
The input has one line which contains a number which is the amount of fuel required by the car in travelling 1 km space separated by the total distance the car has to cover.
Constraints
Both numbers < 1000
Output
Output one string based on the conditions mentioned above.
Sample Output 1
Go On
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int eng= sc.nextInt();
int asu= sc.nextInt();
int fin =eng*asu;
if (fin<=50){
System.out.println("Go On");
}else {
System.out.println("Enough");
}
}
}
No comments:
Post a Comment