Pagini recente » Cod sursa (job #1674507) | Istoria paginii runda/winners28 | Cod sursa (job #1214820) | Cod sursa (job #2240713) | Cod sursa (job #523336)
Cod sursa(job #523336)
#include<iostream.h>
#include<fstream.h>
ifstream f("text.in");
ofstream g("text.out");
int main(){
char x;
int i=0,nr=0,s=0,ok=0;
f>>x;
while(f.peek()!=EOF){
if(ok==0){
while((x<'a'||x>'z')&&(x<'A'||x>'Z')){
x=f.get();
}
ok=1;
}
else{
nr++;
while((x>='a'&&x<='z')||(x>='A'&&x<='Z')){
s++;
x=f.get();
}
ok=0;
}
}
cout<<s/nr;
f.close();
g.close();
return 0;
}