Cod sursa(job #35399)
| Utilizator | Data | 22 martie 2007 00:30:26 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<fstream.h>
#include<string.h>
#include<stdlib.h>
int main(){
ifstream fin("text.in");
ofstream fout("text.out");
char a[5001];
long long S=0,l=0,nr=0;
for (short y=0;y<1000;y++){
fin.getline(a,5000);
if (strlen(a)==0)
break;
else{
for (long i=0;i<=strlen(a);i++)
if (a[i]>96&&a[i]<123||a[i]>64&&a[i]<91){
S++;
l=1; }
else
if (l==1){
nr++;
l=0;} } }
if (y>0)
nr--;
fout<<S/nr;
fin.close();
fout.close();
return 0;
}