2016年11月10日 星期四

TIOJ 1328 - 超基礎排序

http://tioj.infor.org/problems/1328

真的很基礎 連sort都用不到
仔細看好題目(?



 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#include<bits/stdc++.h>
using namespace std;
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int n,i;
    string jizz;
    while(cin>>n && n){
        getline(cin,jizz);
        getline(cin,jizz);
        for(i=1;i<=n;i++){
            if(i-1)cout<<' ';
            cout<<i;
        }
        cout<<'\n';
    }
}

沒有留言:

張貼留言