Cod sursa(job #768500)
Utilizator | Data | 17 iulie 2012 00:56:51 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<string.h>
#include<fstream>
using namespace std;
int ltot, nrtot, start;
char b;
int main()
{
ifstream f("text.in");
while(!f.eof())
{ f.get(b);
if((b>='A'&&b<='Z')||(b>='a'&&b<='z'))
{ltot++; start=1;}
else
if(start==1)
{nrtot++; start=0;}
}
ofstream g("text.out");
g<<ltot/nrtot;
f.close();
g.close();
return 0;
}