Cod sursa(job #1588017)
Utilizator | Data | 2 februarie 2016 18:54:34 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main(){
char c;
int k=0,p=0,ok=0;
while(!in.eof()){
in.get(c);
ok=0;
if((c>='a'&& c<='z')||(c>='A'&&c<='Z')){
ok=1;
k++;
}
while(!in.eof()&&(c>=65&& c<=90)||(c>=97&&c<=122)){
in.get(c);
k++;
}
if(ok==1)p++;
}
out<<k/p;
return 0;
}