Cod sursa(job #2427111)
Utilizator | Data | 30 mai 2019 21:56:04 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int cuvinte = 0, litere = 0, contor = 0;
char l;
while(fin.get(l))
{
if(isalpha(l))
{
++litere;
++contor;
}
else
{
if(litere != 0)
{
litere = 0;
++cuvinte;
}
}
}
fout << contor / cuvinte;
return 0;
}