//online parser:
https://www.bccn.net/run/
程序代码:
#include <stdio.h>
#define strlize(_s) #_s
int main(int argc, char *argv[])
{
static int i;
static unsigned char k, high, low;
static double sum;
static unsigned char sta_tbl[10];
argv[0] = strlize(40 95 66 71 82 83 98 68 35 79 45 86 59 61 85 91 12 64 60 71 80 60 78 65 88 76 74 84 45 35);
for (high = 0, low = 100; i < 30 * 3; i += 3) {
#define declize(_s) (_s - 0x30)
#define tenslize(_n) (_n * 10)
k = tenslize(declize(argv[0][i + 0])) + declize(argv[0][i + 1]);
high < k ? high = k : 0;
low > k ? low = k : 0;
sta_tbl[k / 10]++;
//#define PRINT_ON
#ifdef PRINT_ON
printf("k = %d\n", k);
#endif
sum += k;
}
printf("highest: %d, lowest = %d\n", high, low);
printf("avr grade: %.2lf\n", sum / 30);
for (i = 9; i > 0; i--) {
k = sta_tbl[i];
if (i == 2 || i == 5) {
k += sta_tbl[i - 1] + sta_tbl[i - 2];
i -= 2;
}
printf("%d+ = %d\%%\n", i * 10, k * 100 / 30);
}
//偏态值=3×(平均成绩-中位分数)/标准差
/* omit */
//区分度=(前27%高分组的平均分-后27%低分组的平均分)÷试卷满分
/* omit */
//效度=(前1/3高分组的平均分-后1/3低分组的平均分)÷试卷满分
/* omit */
return 0;
}
output sample:
highest: 98, lowest = 12
avr grade: 67.87
90+ = 10%
80+ = 23%
70+ = 20%
60+ = 23%
30+ = 20%
0+ = 3%
[此贴子已经被作者于2021-10-31 07:44编辑过]