Cod sursa(job #2212179)
Utilizator | Data | 13 iunie 2018 15:51:35 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int cnt = 0, ok = 0, cuvinte = 0;
char a;
while (fin >> noskipws >> a)
{
if (a >= 'A' && a <= 'z')
{
cnt++;
ok = 1;
}
else
{
if (ok == 1)
{
cuvinte++;
ok = 0;
}
}
}
if (ok == 1)
{
cuvinte++;
}
fout << cnt / cuvinte;
return 0;
}