-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathSolution.java
More file actions
27 lines (22 loc) · 874 Bytes
/
Copy pathSolution.java
File metadata and controls
27 lines (22 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import java.util.Scanner;
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double payment = scanner.nextDouble();
scanner.close();
String formatted = String.format("%,.2f", payment);
System.out.println("US: $" + formatted);
System.out.println("India: Rs." + formatted);
System.out.print("China: ");
System.out.write(0xEF);
System.out.write(0xBF);
System.out.write(0xA5);
System.out.println(formatted);
String franceFormatted = formatted.replace(',', (char) 0x00A0).replace('.', ',');
System.out.print("France: " + franceFormatted + " ");
System.out.write(0xE2);
System.out.write(0x82);
System.out.write(0xAC);
System.out.println();
}
}