Cod sursa(job #1330528)
Utilizator | Data | 30 ianuarie 2015 19:17:23 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
#include <fstream>
#include <string>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
int l = 0, ok = 0, c = 0;
char s;
while( !in.eof() ) {
in.get(s);
if( isalpha(s) ) {
l++;
ok=1;
}
else if( ok == 1 ) {
c++;
ok=0;
}
}
out << l / c << '\n';
return 0;
}