Cod sursa(job #2205068)
| Utilizator | Data | 17 mai 2018 20:46:56 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
#include <algorithm>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
int main()
{
char c;
int cuvinte = 0,lungime = 0;
while(cin.get(c)){
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')){
cuvinte++;
lungime++;
while((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
{
lungime++;
cin.get(c);
}
}
}
cout << lungime/cuvinte;
return 0;
}
