Pagini recente » Cod sursa (job #704601) | Cod sursa (job #926079) | Cod sursa (job #1316449) | Cod sursa (job #714713) | Cod sursa (job #523337)
Cod sursa(job #523337)
#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;
}
}
g<<s/nr;
f.close();
g.close();
return 0;
}