Pagini recente » Cod sursa (job #1466844) | Cod sursa (job #2632745) | Cod sursa (job #2443921) | Cod sursa (job #1699244) | Cod sursa (job #1526517)
#include <stdio.h>
#include <stdlib.h>
#define A (ch>='A' && ch<='Z') || (ch>='a' && ch<='z')
char ch;
int nrlitere=0;
int nrcuv=0;
int mod;
int spy;
void verif(){
if(ch=='\n' || mod==-1){
printf("%d",nrlitere/nrcuv);
exit(0);
}
}
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
ch='\n';
while(1){
mod=scanf("%c",&ch);
verif();
if(A){
nrlitere++;
spy=1;
}else if(spy==1){
nrcuv++;
spy=0;
}
}
return 0;
}