UVA 272 Java

  1. import java.util.*;
  2.  
  3. public class main{
  4. public static void main(String[] args) {
  5. Scanner sc=new Scanner(System.in);
  6. boolean check = true;
  7. while(sc.hasNextLine())
  8. {
  9. String str = sc.nextLine();
  10. for(int i=0; i < str.length(); i++)
  11. {
  12. char c = str.charAt(i);
  13. if(c == '\"')
  14. {
  15. System.out.print(check ? "``" : "\'\'");
  16. check = !check;
  17. }
  18. else
  19. System.out.print(c);
  20. }
  21. System.out.println();
  22. }
  23. }
  24. };

留言

這個網誌中的熱門文章

C# 井字遊戲