Cod sursa(job #712622)
Utilizator | Data | 13 martie 2012 17:40:46 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.3 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in"); ofstream g("text.out");
int n, p, lit;
char c;
int main() {
while (!f.eof()){
c=f.get();
if ((c>='a'&&c<='z')||(c>='A'&&c<='Z')){
lit++;
if (p==0) {p=1; n++;}
}
else p=0;
}
g<<lit/n;
}