Advertisement
Guest User

gay ass

a guest
Nov 26th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public class Gay {
  2.  
  3. /**
  4. * @param args the command line arguments
  5. */
  6. public static void main(String[] args) throws FileNotFoundException, IOException {
  7. // TODO code application logic here
  8. BufferedReader br = new BufferedReader(new FileReader("D:/input.txt"));
  9. String output = "", tmp;
  10. while ((tmp = br.readLine()) != null) {
  11. //ignore 1st line
  12. output+=tmp+"\n";
  13. if((tmp = br.readLine()) != null){
  14. output+=reverseString(tmp+"\n");
  15. }
  16. }
  17. System.out.println(output);
  18. }
  19.  
  20. public static String reverseString(String in){
  21. List<String> list = new LinkedList<String>(Arrays.asList(in.split("")));
  22. String out = "";
  23. for(String c : list) {
  24. out+=c;
  25. }
  26. return out;
  27. }
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement