Cod sursa(job #1245184)
Utilizator | Data | 18 octombrie 2014 18:52:02 | |
---|---|---|---|
Problema | Text | Scor | 80 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
int c=0,l=0,p;
char m,x;
f >> x;
p=isalpha(x);
while(f.get(m))
{
if(isalpha(m)&&p)
{
++l;
}
else if(isalpha(m)&&p==0)
{
++c;
++l;
}
p=isalpha(m);
}
g << l/c;
return 0;
}