Cod sursa(job #2602791)
Utilizator | Data | 17 aprilie 2020 20:55:45 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int lit, cuv;
bool k;
int main()
{
ios_base::sync_with_stdio(false);
fin.tie(NULL), fout.tie(NULL);
char c;
while (fin.get(c))
{
if (isalpha(c)) ++lit, k = true;
else
if (k) ++cuv, k = false;
}
fout << lit / cuv;
fin.close(), fout.close();
return 0;
}