level 9
代码如下:
#include <iostream>
#include <cstdlib>
using namespace std;
const int MaxSize = 100;
int main(void){
char cmd[MaxSize];
cout << "Android Shell v1.0" << endl;
cout << "------------------------------" << endl;
cout << "提示:你既可以直接输入shell命令,也可以先输入\"sh\"间接进入shell" << endl;
cout << "输入exit退出" << endl;
cout << ">" ;
while (cin.getline(cmd,MaxSize)){
if (strcmp(cmd,"exit")==0) break;
system(cmd);
cout << ">" ;
}
return 0;
}
2016年04月02日 11点04分

