-->
当前位置:首页 > 题库

PROGRAMMING:Word order

Luz5年前 (2021-05-10)题库420
Program to read in a positive integer n (n < 100), and then read in n words (no more than 40 characters). Sort these words in dictionary order and output them.
```
#include
#include
int main(){
char s[100][80];
int i,j,n;
scanf("%d",&n); // Number of words read in n
for(i=0; iscanf("%s",s[i]);
//Add your code here
for(i=0; iputs(s[i]);
}
```
###Input format:
An integer n followed by n words.
###Output format:
Output sorted words, one line at a time.
###Input example:
```in
five
Harbin Shanghai Beijing Hongkong Taipei
```
###Output example:
```out
Beijing
Harbin
Hongkong
Shanghai
Taipei
```







answer:If there is no answer, please comment