#include <iostream>
#include <string>
using namespace std;
int main()
{
const int n=6;//定义输入的字符串的个数
string str;//字符串
cout<<"请输入6个字符串";
for(int i=0;i<6;i++){
cin>>str;
if(str[0]=='A')//字符串的第一个字符
cout<<str<<endl;
}
return 0;
}
输入n个字符串,把其中以字母A打头的字符串输出
最新推荐文章于 2023-10-29 19:41:10 发布