Cod sursa(job #1248538)
Utilizator | Data | 25 octombrie 2014 14:25:01 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<iostream>
#include<fstream>
using namespace std;
int main(){
ifstream f("text.in");
ofstream g("text.out");
int count = 0, word = 0;
char b;
int ok=0;
while (!f.eof()){
b = f.get();
if (b >= 'a' && b <= 'z' || b >= 'A' && b <= 'Z'){
count++;
if(ok==0){
word++;
ok=1;
}
}
else
ok=0;
}
g<<(int)(count/word);
return 0;
}