#41468: 不是錯第380236行,就是743116。


yp11251018 (dark-duck-duck)

學校 : 臺北市私立延平高級中學
編號 : 239313
來源 : [203.72.178.2]
最後登入時間 :
2025-10-08 15:21:18

奇怪了,測資明明都對阿。也沒有多印一個換行。

第380236行的 "輸入" 到底是甚麼阿?(不是輸出)

 

#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n;
    cin>>n;
    while(n--){
        string s;
        cin>>s;
        sort(s.begin(),s.end());
        cout<<s<<"\n";

        while(next_permutation(s.begin(),s.end())){
            cout<<s<<"\n";
        }
        if(n!=0){
                cout<<"\n";
        }
    }

    return 0;
}

#41480: Re: 不是錯第380236行,就是743116。


yp11251018 (dark-duck-duck)

學校 : 臺北市私立延平高級中學
編號 : 239313
來源 : [203.72.178.2]
最後登入時間 :
2025-10-08 15:21:18

奇怪了,測資明明都對阿。也沒有多印一個換行。

第380236行的 "輸入" 到底是甚麼阿?(不是輸出)

 

#include

using namespace std;

int main()
{
    int n;
    cin>>n;
    while(n--){
        string s;
        cin>>s;
        sort(s.begin(),s.end());
        cout<

        while(next_permutation(s.begin(),s.end())){
            cout<        }
        if(n!=0){
                cout<<"\n";
        }
    }

    return 0;
}

1.380236的輸入還是不知道

2.假如錯測試執行,像是OLE<-這是多輸出一個換行,不要在意

3.錯743116行的話 -> 在每一行的所有排列組合輸出完後都輸出一個換行(不要管測試執行)(總共兩個換行)