Cod sursa(job #570993)
Utilizator | Data | 3 aprilie 2011 20:46:20 | |
---|---|---|---|
Problema | Text | Scor | 80 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int l, c, k=1;
char a;
int main()
{ f>>a;
while(a!=EOF) { a=f.get();
if((a>='a' && a<='z') || (a>='A' && a<='Z')) { ++l;
if(k) { ++c;
k=0;
}
}
else k=1;
}
g<<l/c;
}