Cod sursa(job #2609080)
Utilizator | Data | 2 mai 2020 10:13:56 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | igorj_mentorat1 | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char c, ant;
int ncuv, lg;
int main()
{
while (!f.eof())
{
c = f.get();
if (f.eof())
break;
if (isalpha(c))
lg++;
else if (isalpha(ant))
ncuv++;
ant = c;
}
if (isalpha(ant))
ncuv++;
g << lg / ncuv;
return 0;
}