Cod sursa(job #236828)
Utilizator | Vlad Schnakovszki shnako | Data | 28 decembrie 2008 16:44:36 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream.h>
#include <stdio.h>
#include <ctype.h>
ofstream g("text.out");
int s=0, c;
bool sw;
char x;
int main()
{
freopen("text.in","r",stdin);
while(scanf("%c", &x)!=EOF)
{
sw=1;
while (!isalpha(x)&&scanf("%c", &x)!=EOF)
sw=1;
while (isalpha(x))
{
sw=0;
s++;
scanf("%c", &x);
}
if (sw==0)
c++;
}
g<<s<<" "<<c;
g.close();
return 0;
}