文章

55

粉丝

57

获赞

11

访问

11.4k

头像
国名排序 题解:sort函数秒了
P1217 同济大学机试题
发布于2024年3月9日 23:44
阅读数 358

#include<stdio.h>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;

int main(){
    int n;
    cin>>n;
    string str[n];
    for(int i = 0; i<n; i++){
        cin>>str[i];
    }
    sort(str,str+n);
    for(int i = 0; i<n;i++){
        cout<<str[i]<<endl;
    }
}


 
登录查看完整内容


登录后发布评论

暂无评论,来抢沙发