效果图: 请输入字符串个数 4 请输入n个字符串 chengshaolei chenruizi wuyongliang shanbo 输入完毕 现在反序输出 shanbo wuyongliang chenruizi chengshaolei 请按任意键继续。。。。。。。。
/*功能:内存空间管理——相反输出日期:2013-09-08*/
#include<iostream>
using namespace std;
int main(void){ int n,i,j; char Ch[1000][1000];
//输入 cout << "请输入字符串个数:n" << endl;
cin >> n;
cout << "请输入n个字符串:n" << endl;
for (i=0;i<n;i++) {
cin >> Ch[i];
}
//输出 cout << "现在反序输出:n" << endl;
for (i=n-1;i>=0;i--) {
cout << Ch[i] <<endl;
}
//结束 system("pause"); return 0;}
评论