Cod sursa(job #2611046)
Utilizator | Data | 6 mai 2020 11:06:02 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c1, c2;
int cnt_let, cnt_wrd;
int main()
{
while(fin.get(c1))
{
if(isalpha(c1))
cnt_let++;
else if(isalpha(c2))
cnt_wrd++;
c2=c1;
}
if(isalpha(c2))
cnt_wrd++;
fout << cnt_let/cnt_wrd;
return 0;
}