Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Problem_06_FormattingNums {
- public static void main(String[] args) {
- Scanner input = new Scanner(System.in);
- int a = input.nextInt();
- float b = input.nextFloat();
- float c = input.nextFloat();
- String hex = Integer.toHexString(a);
- String binnary = Integer.toBinaryString(a);
- System.out.printf("|%0-10s|" + "%010s|" + "%010.2f|" + "%0-10.3f|",hex,binnary,b,c);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement