튜토리얼 Lecture 관련 질문입니다.

  • akainoo
    akainoo
    #include <iostream>
    #include <cstring>
    #include <vector>
    #include <algorithm>
    
    using namespace std;
    
    int main(){
        int T;
        cin>>T;
        for(;T>0;T--){
            string BeforeSort,Sorted;
            cin>>BeforeSort;
            vector<string> Test;
            for(int i=0;i<BeforeSort.length()/2;i++){
                Test.push_back(BeforeSort.substr(i*2,2));
            }
            sort(Test.begin(),Test.end());
            for(int i=0;i<Test.size();i++){
                Sorted+=Test[i];
            }
            cout<<Sorted;
        }
    }
    

    튜토리얼 Lecture 코드입니다. 왜 오답이 뜨는지 전혀 모르겠습니다.
    여러가지를 해봤는데 다 정상적으로 출력값을 내서..


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