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

Ended

Participants:899

Verdict:Wrong Answer
Score:80 / 100
Submitted:2016-08-07 14:17:28

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 <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
int m, n, l, ii, i, j, loop;
long long len, line, mm;
bool f = true;
char a[201];
char word[201][201];
int c[100000001], cl[100000001], w[201];
int main()
{
    scanf("%d %d\n", &m, &n);
    mm = m;
    cin.getline(a, 201);
    len = strlen(a);
    a[len] = ' ';
    a[++ len] = '\0';
    len -= 1;
    l = 1;
    memset(w, 0, sizeof(w));
    for (i = 0; i < strlen(a); ++ i)
    if (a[i] != ' ')
    {
        w[l] ++;
    }
    else
    {
        l ++;
    }
    l --;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX