Cod sursa(job #664990)
| Utilizator | Data | 21 ianuarie 2012 13:10:32 | |
|---|---|---|---|
| Problema | Text | Scor | 20 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<iostream>
#include<fstream>
using namespace std;
int lit=0, ok=0, ceva, nrcuv=0;
char x;
int main()
{
ifstream f("text.in");
ofstream h("text.out");
x=f.get();
while (!f.eof())
{
if ((x>='a' && x<='z') || (x>='A' && x<='Z'))
{
lit=lit+1;
ok=0;
}
else
ok=1;
if (ok==1 && lit>0)
nrcuv=nrcuv+1;
x=f.get();
}
ceva=lit/nrcuv;
h<<ceva;
f.close();
h.close();
return 0;
}
