Cod sursa(job #1261567)
| Utilizator | Data | 12 noiembrie 2014 15:48:45 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
char c;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int cuv=0, lit=0, ok=0;
while(fin.get(c))
{
if(ok==0) {
if((c >= 'a' && c <='z') || (c >= 'A' && c <= 'Z' ))
{
cuv++;
lit++;
ok=1;
}
}
else if(ok==1)
{
if((c >= 'a' && c <='z') || (c >= 'A' && c <= 'Z' ))
lit++;
else ok=0;
}
}
fout<< lit/cuv;
fin.close();
fout.close();
return 0
;
}
