#include <stdio.h>
int main(int argc, char *argv[])
{
signed char a1,a2,a3,a4,a5,a6,a7,a8,a9,a10;
int i,cnt = 0;
printf("No.1 =?");scanf("%d", &i);a1 = i;
printf("No.2 =?");scanf("%d", &i);a2 = i;
printf("No.3 =?");scanf("%d", &i);a3 = i;
printf("No.4 =?");scanf("%d", &i);a4 = i;
printf("No.5 =?");scanf("%d", &i);a5 = i;
printf("No.6 =?");scanf("%d", &i);a6 = i;
printf("No.7 =?");scanf("%d", &i);a7 = i;
printf("No.8 =?");scanf("%d", &i);a8 = i;
printf("No.9 =?");scanf("%d", &i);a9 = i;
printf("No.10 =?");scanf("%d", &i);a10 = i;
if(a1 < 40) cnt++;
if(a2 < 40) cnt++;
if(a3 < 40) cnt++;
if(a4 < 40) cnt++;
if(a5 < 40) cnt++;
if(a6 < 40) cnt++;
if(a7 < 40) cnt++;
if(a8 < 40) cnt++;
if(a9 < 40) cnt++;
if(a10 < 40) cnt++;
printf("40未満の個数は%d個\n", cnt);
return 0;
}
数値入力の際に200とか入力してみるところがキモ。