Cod sursa(job #150914)
Utilizator | Data | 7 martie 2008 16:51:59 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<fstream.h>
#include<iomanip.h>
#include<string.h>
#include<stdio.h>
int i,j,k,l;
char x[6000];
int main(){
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof()){
f/*>>resetiosflags(ios::skipws)*/>>x;
k=strlen(x);
for(i=0;i<k;i++)
{if(((x[i]>='A')&&(x[i]<='Z'))||((x[i]>='a')&&(x[i]<='z')))
{j++;
while(((x[i]>='A')&&(x[i]<='Z'))||((x[i]>='a')&&(x[i]<='z')))
{l++;i++;}
}
}}
l/=j;
g<<l;
f.close();
g.close();
return 0;
}