Cod sursa(job #2199582)
Utilizator | Data | 28 aprilie 2018 13:08:12 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char v[1000];
int main()
{
int nr = 0, nrc = 0;
bool ok = false;
while(fin >> v) {
for(int i = 0; i < strlen(v); i++) {
if(isalpha(v[i]))
nr++, ok = true;
else {
if(ok) nrc++, ok = false;
}
}
if(ok) nrc++;
ok = false;
}
fout << nr / nrc;
return 0;
}