当前位置:首页  精选百科

精选百科

本题要求编写程序读入n个学生(本题要求编写程序读入5个字符串按由小到大的顺序输出)

2023-06-06 21:44:33
导读 大家好,小东方来为大家解答以上的问题。本题要求编写程序读入n个学生,本题要求编写程序读入5个字符串按由小到大的顺序输出这个很多人还不

大家好,小东方来为大家解答以上的问题。本题要求编写程序读入n个学生,本题要求编写程序读入5个字符串按由小到大的顺序输出这个很多人还不知道,现在让我们一起来看看吧!

1、//程序开始#include #include #include using namespace std;#define ___ int main(){return atexit(__);}#define ____ void __(){#define _____ system("pause"); }____unsigned us(0);string str("");list vec;while (getline(cin, str), vec.push_back(str), vec.size()<5);vec.sort();copy(vec.begin(), vec.end(), ostream_iterator(cout, ""));________ //程序结束//=======================================================以上vs2008通过我个人感觉楼上的是错误的 比如说 每个字符串都是0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000他是没法排序的 程序崩掉了。

本文到此分享完毕,希望对大家有所帮助。

免责声明:本文由用户上传,如有侵权请联系删除!