Cod sursa(job #3036456)
Utilizator | Candidatu Mario Luca dragoncrack | Data | 24 martie 2023 13:02:15 |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.73 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin ("teren.in");
ofstream fout("teren.out");
int litere, cuvinte;
char cuvant[1200005];
int main()
{
while(fin >> cuvant)
{
bool cuvantNou = true;
int limita = strlen(cuvant);
for(int i = 0; i < limita; i++)
{
if((cuvant[i] >= 'a' && cuvant[i] <= 'z') || (cuvant[i] >= 'A' && cuvant[i] <= 'Z'))
{
if(cuvantNou)
{
cuvantNou = false;
cuvinte++;
}
litere++;
}
else
cuvantNou = true;
}
}
fout << litere / cuvinte;
}