Pagini recente » Cod sursa (job #289535) | Cod sursa (job #948701) | Cod sursa (job #1214679) | Cod sursa (job #2383057) | Cod sursa (job #1235816)
#include <stdio.h>
#define FIN "text.in"
#define FOUT "text.out"
#define L long
L count_ch = 0,
count_wo = 0,
len;
int ok = 0;
//function prototypes
void readAndSolve();
int main() {
readAndSolve();
return(0);
}
void readAndSolve() {
char c;
freopen(FIN, "r", stdin);
freopen(FOUT, "w", stdout);
while(!feof( stdin )) {
scanf("%c", &c);
if(!ok && isalpha(c)) {
++count_wo;
ok = 1;
++count_ch;
} else if(ok && isalpha(c)) {
++count_ch;
} else if(ok && !isalpha(c)) {
ok = 0;
}
}
printf("%ld",(count_ch)/(count_wo));
fclose( stdin );
fclose( stdout );
}