We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
what is the problem i couldn't understand please help me:
import java.io.;
import java.util.;
import java.text.;
import java.math.;
import java.util.regex.*;
public class Prob
{
public static void main(String[] args)
{int x[];
int y[];
Scanner in = new Scanner(System.in);
Day 2: Basic Probability Puzzles #4
You are viewing a single comment's thread. Return to all comments →
what is the problem i couldn't understand please help me: import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*; public class Prob {
public static void main(String[] args) {int x[]; int y[]; Scanner in = new Scanner(System.in);
for(int i=0;i<2;i++) { x[i]=in.nextInt(); } for(int i=0;i<2;i++) { y[i]=in.nextInt(); } int prob1,prob2; prob1 = x[1] * (y[1]+1); prob2 = (x[0]+x[1])*((y[0]+y[1])+1);
System.out.println(prob1+"/"+prob2); } }