怎么计算总和
程序代码:
void diancai() { system("cls"); char num[50], name[50], money[50]; int n; char ch[2]; int sum; FILE * fp; fp = fopen("zengjia_c.txt", "r"); rewind(fp); while (!feof(fp)) { fscanf(fp, "%s%s%s\n", num, name, money); printf("%s\t\t\t%s\t\t\t%s\n", num, name, money); } printf("是否点菜(Y/N)"); scanf("%s", ch); while (strcmp(ch, "Y") == 0 || strcmp(ch, "y") == 0){ printf("请输入要选择的菜的编号:"); scanf("%s", num); printf("请输入要选择的菜的数量:"); scanf("%d", &n); printf("是否继续点菜(Y/N)"); scanf("%s", ch); } sum= }
点菜的一个小模块 ,总和不会计算,谁能帮我写一下