Cod sursa(job #1780831)
| Utilizator | Data | 16 octombrie 2016 16:12:09 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | simulare_emag_mediu_2016_runda1 | Marime | 0.66 kb |
#include<conio.h>
#include<fstream>
#include<iostream>
#include<cstring>
using namespace std;
int nrLit=0, nrCuv=0,ok=0;
char c,ant=0;
fstream fin("text.in",ios::in);
fstream fout("text.out",ios::out);
int main()
{
while(fin>>noskipws>>c)
{
if('a'<=c && c<='z' || 'A'<=c && c<='Z')
{
nrLit++;
ok=1;
}
else
{
if(ok==1)
{
nrCuv++;
ok=0;
}
}
}
if(ok==1)
{
nrCuv++;
ok=0;
}
fout<<nrLit/nrCuv;
fin.close();
fout.close();
return 0;
}
