Cod sursa(job #266387)
| Utilizator | Data | 25 februarie 2009 13:25:48 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
//http//infoarena.ro/problema/text
#include<fstream.h>
#include<string.h>
#include<stdio.h>
#define NM 2048576
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
int l,i,cuv=0,car=0;
char s[NM+11],c=' ';
fin.get(s,NM+10);
l=strlen(s);
for(i=0;i<l;i++){
if(s[i]>='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z'){car++;
if(!(c>='a'&&c<='z'||c>='A'&&c<='Z'))cuv++;
}
c=s[i];
}
if(car==0) fout<<"0";
else
fout<<car/cuv;
return 0;
}