[Offer收割]编程练习赛30 register

Ended

Participants:188

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-08 12:11:48

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#include<cstdlib>
using namespace std;
int main()
{
    char a[900];
    cin.getline(a, 801);
    for (int i = 0; i < strlen(a); i++)
    {
        if (a[i] == '@')
        {
            int j = i + 1;
            while (((a[j] <= 'Z' &&a[j] >= 'A') || (a[j] <= 'z'&&a[j] >= 'a')) && j < strlen(a))
            {
                j++;
            }
            if(j>i+1)
            {
                for (int k = i + 1; k < j; k++)
                {
                    cout << a[k];
                }
                cout << " ";
            }
            
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX