#include<bits/stdc++.h>
using namespace std;
int main()
{
char s[1000], a[100];
char *p;
int i, j, l, k, t;
while(gets(s))
{
i = j = t = 0;
p = strtok(s, " ");
while(p != NULL)
{
strcpy(a, p);
l = strlen(a);
k=0;
while(k<=l)
{
while(((a[k]>=65 && a[k]<=90) || (a[k]>=97 && a[k]<=122)) && k<l)
{
i++;
k++;
}
if(i>0)
{
j++;
i = 0;
}
k++;
}
i = 0;
p = strtok(NULL, " ");
}
cout << j << endl;
}
return 0;
}
using namespace std;
int main()
{
char s[1000], a[100];
char *p;
int i, j, l, k, t;
while(gets(s))
{
i = j = t = 0;
p = strtok(s, " ");
while(p != NULL)
{
strcpy(a, p);
l = strlen(a);
k=0;
while(k<=l)
{
while(((a[k]>=65 && a[k]<=90) || (a[k]>=97 && a[k]<=122)) && k<l)
{
i++;
k++;
}
if(i>0)
{
j++;
i = 0;
}
k++;
}
i = 0;
p = strtok(NULL, " ");
}
cout << j << endl;
}
return 0;
}
Comments
Post a Comment