输入n个字符串,将以A打头的字符串输出

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string str[80];
    int i, n;
    cout<<"Please enter string number: ";
    cin>>n;
    for (i=0; i<n; i++){
        cout<<"Please enter No."<<i+1<<" string: ";
        cin>>str[i];
    }
    for (i=0; i<n; i++)
        if (str[i][0]=='A')
            cout<<str[i]<<endl;
    system("pause");
    return 0;
}
--------------------- 
作者:Navigator_Z 
来源:CSDN 
原文:https://blog.csdn.net/navicheung/article/details/81283254 
版权声明:本文为博主原创文章,转载请附上博文链接!
posted @ 2018-11-21 18:46  小Aer  阅读(221)  评论(0编辑  收藏  举报