Cod sursa(job #1252010)
Utilizator | Data | 30 octombrie 2014 10:48:54 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int l=0, wl=0, w=0;
char x;
ifstream fin;
ofstream fout;
fin.open("text.in");
fout.open("text.out");
while (!fin.eof())
{
fin.get(x);
if (65 <= x && x <= 90 || 97 <= x && x <= 122)
{
l = l + 1;
if (wl == 0)
w = w + 1;
wl = wl + 1;
}
else
wl = 0;
}
fout << l / w;
return 0;
}