Cod sursa(job #663487)
| Utilizator | Data | 18 ianuarie 2012 16:26:20 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.46 kb |
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main()
{
int k=0,nr=0,i,j;
char a[1000];
ifstream fin("text.in");
ofstream fout("text.out");
while(fin>>a)
{
i=strlen(a);
for(j=0;j<=i;j++)
{
if((('a'<=a[j])&&(a[j]<='z'))||(('A'<=a[j])&&(a[j]<='Z')))
{
k++;
while((('a'<=a[j])&&(a[j]<='z'))||(('A'<=a[j])&&(a[j]<='Z')))
{
nr++;
j++;
}
}
}
}
cout<<nr/k;
return 0;
}