Cod sursa(job #551002)
Utilizator | Data | 10 martie 2011 11:02:52 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <fstream.h>
#include <string.h>
char s;
long long nc,nt,nr,i,sw;
int main()
{
ifstream fin("text.in");
while(!fin.eof())
{
s=fin.get();
if((s>='a' && s<='z') || (s>='A' && s<='Z'))
{
nc=nr+1;
nt++;
}
else
nr=nc;
}
fin.close();
ofstream fout("text.out");
fout<<nt/nc;
fout.close();
return 0;
}