Cod sursa(job #2464389)
| Utilizator | Data | 28 septembrie 2019 14:43:07 | |
|---|---|---|---|
| Problema | Text | Scor | 70 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.6 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char S;
int Litera(char ch)
{
if(ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z')
{
return 1;
}
return 0;
}
int main()
{
bool Cuv = false;
int K = 0, nrC = 0, nrL = 0;
while(fin.get(S))
{
if(Litera(S))
{
if(Cuv)
{
nrC++;
Cuv = false;
}
nrL++;
}
else Cuv = true;
}
fout << nrL / nrC;
return 0;
}
