Cod sursa(job #1781360)
Utilizator | Data | 16 octombrie 2016 20:14:16 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | simulare_emag_mediu_2016_runda1 | Marime | 0.41 kb |
#include <iostream>
#include<fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
char x,n,pr;
int lit,cuv;
while(fin.get(x))
{
if ((x>='a'&&x<='z')||(x>='A'&&x<='Z'))
lit++;
else
if ((pr>='a'&&pr<='z')||(pr>='A'&&pr<='Z'))
cuv++;
pr = x;
}
fout<<lit/cuv;
return 0;
}