Cod sursa(job #29236)
Utilizator | Lobont Andrei JacKtHeRIpEr | Data | 8 martie 2007 20:09:17 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.55 kb |
#include"fstream.h"
#include"string.h"
main()
{
ifstream f("text.in");
ofstream o("text.out");
unsigned long lit;
unsigned int cuv, i;
char l[30];
while(!f.eof)
{
f>>l;
if((strcmp(l[0],'a')>=0 && strcmp(l[0],'z')<=0) || (strcmp(l[0],'A')>=0 && strcmp(l[0],'Z')<=0)
{
cuv++;
for(i=1;i<=strlen(l);i++)
if((strcmp(l[i],'a')>=0 && strcmp(l[i],'z')<=0) || (strcmp(l[i],'A')>=0 && strcmp(l[i],'Z')<=0)
lit++;
else
cuv++;
}
}
}