Cod sursa(job #2642643)
| Utilizator | Data | 16 august 2020 14:04:21 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.61 kb |
#include <iostream>
#include <string.h>
#include <fstream>
using namespace std;
bool esteLitera (char c)
{
return (c>='A' && c<='Z') || (c>='a' && c<='z');
}
int main()
{
ifstream fin ("text.in");
fin >> noskipws;
int nrLit=0, nrCuv=0;
while(!fin.eof())
{
char c;
fin >> c;
if (esteLitera(c))
{
nrCuv++;
while (esteLitera(c))
{
nrLit++;
fin>>c;
}
}
}
ofstream fout ("text.out");
fout << nrLit / nrCuv;
return 0;
}
