如果是Linux环境下的话比较好实现,代码如下:#include #include using namespace std;int main(){ string input; cout<<"Please enter the file type: "; cin>>input; cout< system("find ~ -name *."input" -print"); return 0;}