Cod sursa(job #1890810)
| Utilizator | Data | 23 februarie 2017 15:35:51 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <fstream>
#include <iostream>
#include <ctype.h>
using namespace std;
ofstream g("text.out");
int main()
{
ifstream fin;
fin.open("text.in", ios:: in);
char caracter_curent = '\0';
int lungime_totala = 0, nr_cuvinte = 0;
while (!fin.eof())
{
fin.get(caracter_curent);
if (tolower(caracter_curent) >= 'a' && tolower(caracter_curent) <= 'z')
++lungime_totala;
else
++nr_cuvinte;
}
g << lungime_totala / nr_cuvinte;
return 0;
}