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

Ended

Participants:188

Verdict:Accepted
Score:100 / 100
Submitted:2017-10-08 12:24:30

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 <set>
#include <map>
#include <cctype>
#include <vector>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
char str[1000], res[1000];
int main(){
    cin.getline(str, 1000);
    int len = strlen(&str[0]);
    bool flag = false;
    int cnt;
    int ttt = 0;
    for (int i = 0; i < len; i++) {
        if (flag){
            if (isalpha(str[i])){
                res[ttt++] = str[i];
                cnt++;
            }
            else if (str[i] == '@'){
                if (cnt > 0)res[ttt++] = ' ';
                cnt = 0;
                flag = true;
            }
            else {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX