Cod sursa(job #2908726)
| Utilizator | Data | 5 iunie 2022 14:28:01 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
int main()
{
ifstream fin("text.in");
ofstream fout("text.out");
char c[10000];
fin.get(c, 10000);
//cout << c;
int nr_cuvinte = 0;
int nr_litere = 0;
int in_cuvant = 0;
for(int i = 0; c[i]; i++)
{
if(c[i] >= 'A' && c[i] <= 'z')
{
nr_litere++;
in_cuvant = 1;
}
else
{
if(in_cuvant == 1)
{
nr_cuvinte++;
in_cuvant = 0;
}
}
}
cout << nr_litere / nr_cuvinte;
return 0;
}