Cod sursa(job #583696)
Utilizator | Data | 21 aprilie 2011 22:00:48 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
#define isup(x) (x>='a' && x<='z')
#define islow(x) (x>='A' && x<'Z')
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int maxs , i , ok;
char c;
int main()
{
while(!f.eof())
{
f.get(c);
if(isup(c) || islow(c)) ++maxs , ok = 1;
else
if(ok) ++i,ok = 0;
}
if(ok) ++i;
g<<maxs/i;
return 0;
}