OJ "The string with the beginning of a word" in the brush title

Source: Internet
Author: User

Description

Output N a string that takes the letter A the beginning of the string output.

Input

First line N

second line to section n+1 rows, one string per line

Output

A preceded String

Sample Input

3

Ada

Bob

Alice

Sampleoutput

Ada

Alice


The code is as follows:

#include <iostream> #include <cstring>using namespace Std;int main () {    int i,n;    String str[10];    cin>>n;    for (i=0;i<n;i++)    {        cin>>str[i];    }    for (i=0;i<n;i++)    {        if (str[i][0]== ' A ')        {            cout<<str[i]<<endl;        }    }    return 0;}


Operation Result:




Also mastered a knowledge point, you can use a[[] to represent a position in a string.

OJ "The string with the beginning of a word" in the brush title

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.