Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions hackerrank/Day2.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ static void solve(double meal_cost, int tip_percent, int tax_percent) {

}

private static final Scanner scanner = new Scanner(System.in);
private static final Scanner sc = new Scanner(System.in);

public static void main(String[] args) {
double meal_cost = scanner.nextDouble();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
double meal_cost = sc.nextDouble();
sc.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

int tip_percent = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
int tip_percent = sc.nextInt();
sc.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

int tax_percent = scanner.nextInt();
scanner.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");
int tax_percent = sc.nextInt();
sc.skip("(\r\n|[\n\r\u2028\u2029\u0085])?");

solve(meal_cost, tip_percent, tax_percent);

scanner.close();
sc.close();
}
}