10viii.cpp
来自「《C/C++程序设计导论(第二版)》一书的程序源文件」· C++ 代码 · 共 23 行
CPP
23 行
// wordsort.cpp Sort and output a list of 10 words from a list provided by
// the user.
#include <iostream>
#include <fstream>
#include <string>using namespace std;const int SIZE =10;
void Sort (string[], int);
void main ()
{ string words[SIZE];
int n;
for (n=0; n<SIZE; n++) // input the list of words
cin >> words[n];
Sort (words, SIZE); // sort the list
cout << "sorted words are:" << endl;
for (n=0; n<SIZE; n++) // output the list
cout << words[n] << endl;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?