Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.Ch1_ArraysAndStrings;
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.util.Arrays;
- public class WeirdParser {
- public static void main(String[] args) throws IOException {
- BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
- long startingNumber = Long.parseLong(reader.readLine());
- char[] tempArr = Long.toBinaryString(startingNumber).toCharArray();
- char[] num = new char[64];
- Arrays.fill(num, '0');
- System.arraycopy(tempArr, 0, num, num.length - tempArr.length, tempArr.length);
- System.out.println(num);
- while (true) {
- String[] input = reader.readLine().split(" ");
- if ("end".equals(input[0])) {
- break;
- }
- int count = Integer.parseInt(input[1]);
- if("salt".equals(input[0])){
- //do magic
- }else{
- //other magic
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement