import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String input; StringBuffer sb=new StringBuffer(""); while((input=br.readLine())!=null) { int n=Integer.parseInt(input); sb.append(n+" converts to "+Integer.reverseBytes(n)+"\n"); } System.out.print(sb); } }
UVa Problem ID 594 (One Little, Two Little, Three Little Endians)
Previous Post
UVa Problem ID 11340 (Newspaper)
Next Post
UVa Problem ID 11727 (Cost Cutting)
0 comments: