Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import org.apache.commons.lang3.StringUtils;
- public class FormattingNumbers
- {
- public static void main(String[] args)
- {
- Scanner input = new Scanner(System.in);
- int a = input.nextInt();
- float b = input.nextFloat();
- float c = input.nextFloat();
- System.out.printf("|%1$10X|%2$s|%3$10.2f|%4$-10.3f|" + "\r\n", a, StringUtils.leftPad(Integer.toBinaryString(a), 10, '0'), b, c);
- input.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment