saffan tak
standard input/output: 2s/128000 kB
Sara is standing in a line for her turn to see the doctor.
There are N people standing in front of Sara and for
each person, the doctor takes exactly X minutes. Sara
wants to know the time after which her number comes.
Since Sara is weak in maths, your task is to calculate the
time for her.
Input
User Task:
Since this will be a functional problem, you don't have to
take input. You just have to complete the function
waiting Time() that takes integers N and X as
arguments.
Constraints:-
1 <= N <= 1000
1 <= x <= 1000
Output
Return the total time Sara needs to wait before her turn
Answers
Answer:
import java.util.Scanner;
class Main {
public static void main (String[] args) {
int A;
Scanner input = new Scanner(System.in);
A = input.nextInt();
int B;
Scanner input2 = new Scanner(System.in);
B = input2.nextInt();
int res = B*A;
System.out.println(res);
}
}
Explanation:
Answer:
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
// don't change the name of this class
// you can add inner classes if needed
class Main {
public static void main (String[] args) {
Scanner sc = new Scanner(System.in);
int A = sc.nextInt();
int B = sc.nextInt();
int res = B*A;
System.out.println(res); // Your code here
}
}
Explanation:
should use multipy to know waiting time