Cod sursa(job #1324835)
Utilizator | Data | 22 ianuarie 2015 20:40:12 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char a;
int ok=0,k=0,cuv=0;
while (!f.eof())
{f.get(a);
if((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
{k++;
ok=1;
}
else{ if (ok)cuv++;ok=0;}
}
g<<k/cuv;
return 0;
}