URI문제 제 코드 질문합니다

  • kmm
    kmm

    import java.util.Scanner;

    public class Main
    {
    public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int line_num=sc.nextInt();
    String str;

    while(line_num>0){
            str=sc.next();          
            System.out.println(Find_Percent(str));
            line_num--;         
        }
    
    }
    
    public static String Find_Percent(String str){
    
        str=str.replace("%20"," ");
        str=str.replace("%21","!");
        str=str.replace("%24","$");
        str=str.replace("%25","%");
        str=str.replace("%28","(");
        str=str.replace("%29",")");
        str=str.replace("%2a","*");
    
        return str;
    }

    }
    문제 : https://algospot.com/judge/problem/read/URI

    이 코드가 시간은 오래걸리지만 답은 나옵니다. 어느 부분에서 틀렸는지 질문할 수 있을까요??


    8년 전
2개의 댓글이 있습니다.
  • Kureyo
    Kureyo

    '%2528'이 '%28'이 아니라 '('이 될거같네요


    8년 전 link
  • jwl1993
    jwl1993

    %25%28%25%25 도 한번 넣어보시는게 좋을거 같네요


    8년 전 link
  • 정회원 권한이 있어야 커멘트를 다실 수 있습니다. 정회원이 되시려면 온라인 저지에서 5문제 이상을 푸시고, 가입 후 7일 이상이 지나셔야 합니다. 현재 문제를 푸셨습니다.