Cod sursa(job #1727323)
| Utilizator | Data | 10 iulie 2016 15:36:59 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char ch;
int cuvant, litere, cuvinte;
cuvant=litere=cuvinte=0;
while(fin.get(ch))
{
if((ch >= 'A' &&ch <= 'Z')||(ch >= 'a' && ch <= 'z'))
{
litere++;
cuvant=1;
}
else
{
if(cuvant==1) cuvinte++;
cuvant=0;
}
}
fout << litere / cuvinte << "\n";
fin.close();
fout.close();
return 0;
}
