Cod sursa(job #874384)
Utilizator | Data | 8 februarie 2013 11:43:37 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
char s;
int c1=0,c2=0,cuv=0;
ifstream f("text.in");
ofstream g("text.out");
while(!f.eof())
{
f>>s;
if((s>'a'&&s<'z')||(s>'A'&&s<'Z'))
{
c2++;
c1=1;
}
else
if(c1==1)
{
cuv++;
c1=0;
}
}
g<<c2/cuv;
return 0;
}