Cod sursa(job #830795)
Utilizator | Data | 7 decembrie 2012 18:37:58 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
#include <iostream>
#include<string.h>
using namespace std;
int s,poz,i,cuv;
char c;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f>>noskipws>>c;
if((c>='A'&&c<='Z')||(c>='a'&&c<='z'))
{
s++;
poz=1;
}
else
if(poz==1)
{
cuv++;
poz=0;
}
}
g<<s/cuv;
return 0;
}