Cod sursa(job #397162)
Utilizator | Data | 16 februarie 2010 15:40:18 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Pregatire OJI 2010 | Marime | 0.39 kb |
#include<fstream.h>
#include<iostream.h>
int x,nrlitere,nrcuvinte,continuare,t;
char y;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
while(f.get(y))
{
++t;
x=y;
if(65<=x&&x<=90||97<=x&&x<=122)
{
nrlitere++;
if(!continuare)
{
nrcuvinte++;
continuare=1;
}
}
else
continuare=0;
}
g<<nrlitere/nrcuvinte;
return 0;
}