Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Gay {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws FileNotFoundException, IOException {
- // TODO code application logic here
- BufferedReader br = new BufferedReader(new FileReader("D:/input.txt"));
- String output = "", tmp;
- while ((tmp = br.readLine()) != null) {
- //ignore 1st line
- output+=tmp+"\n";
- if((tmp = br.readLine()) != null){
- output+=reverseString(tmp+"\n");
- }
- }
- System.out.println(output);
- }
- public static String reverseString(String in){
- List<String> list = new LinkedList<String>(Arrays.asList(in.split("")));
- String out = "";
- for(String c : list) {
- out+=c;
- }
- return out;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement