Cod sursa(job #2478526)
Utilizator | Data | 22 octombrie 2019 12:28:27 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 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++;
cout << lg / ncuv;
return 0;
}