Pagini recente » Cod sursa (job #2332581) | Cod sursa (job #1300612) | Cod sursa (job #1977059) | Cod sursa (job #682992) | Cod sursa (job #1526481)
#include <stdio.h>
#include <stdlib.h>
#define A (ch>='A' && ch<='Z') || (ch>='a' && ch<='z')
char ch;
int nrlitere=0;
int nrcuv=0;
void verif(){
if(ch=='\n' || ch==EOF){
printf("%d",nrlitere/nrcuv);
exit(0);
}
}
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
ch='\n';
while(1){
while(!(A)){
scanf("%c",&ch);
verif();
}
nrcuv++;
while(A){
nrlitere++;
scanf("%c",&ch);
verif();
}
}
return 0;
}