Cod sursa(job #971808)
Utilizator | Data | 10 iulie 2013 11:42:18 | |
---|---|---|---|
Problema | Text | Scor | 60 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char *a,x[100];
int cuv=0,lit=0;
while(fin>>x)
{
a=x;
if(*a>='A'&&*a<='Z'||*a>='a'&&*a<='z')
{
cuv++;
for(;(*a>='A'&&*a<='Z'||*a>='a'&&*a<='z')||*a=='-';a++)
if(*a=='-')
cuv++;
else
lit++;
}
}
fout<<lit/cuv;
return 0;
}