#include <stdio.h>
#include <stdlib.h>

int main()
{
	char file_name[25];
	FILE *fp;
	int i=0,sum = 0,tmp,cnt = 0;
	int col_s[8];
	
	fp = fopen("student.csv","r");
	if(fp == NULL){
		printf("Opening error.\n");
		return 1;
	}
	fscanf(fp,"%d",&tmp);
	while(feof(fp)){
		sum += tmp;
		cnt++;
		if(cnt % 838 == 0){
			col_s[i] = sum;
			sum = 0;
			i++;
		}
		fscanf(fp,"%d",&tmp);
	}
	printf("\n大一總人數:%d,大二總人數:%d,大三總人數:%d,大四總人數:%d\n",col_s[0]+col_s[1],col_s[2]+col_s[3],col_s[4]+col_s[5],col_s[6]+col_s[7]);
	fclose(fp);
	return 0;
