user-0 提问: 大佬们帮帮看看萌新错在了哪

回复:
user: user-1
content: 代码功能归根结底不是别人帮自己看或讲解或注释出来的；而是被自己静下心来花足够长的时间和精力亲自动手单步或设断点或对执行到某步获得的中间结果显示或写到日志文件中一步一步分析出来的。 提醒：再牛×的老师也无法代替学生自己领悟和上厕所！ 单步调试和设断点调试（VS IDE中编译连接通过以后，按F10或F11键单步执行，按Shift+F11退出当前函数；在某行按F9设断点后按F5执行停在该断点处。）是程序员必须掌握的技能之一。

user: user-0
content: #include<stdio.h> #include<stdlib.h> #define     PER_TEN_YEARS        10 #define     FEMALE_PER_EGGS     2 #define     CADRE_PER_EGGS      5 int main(void) { 	int type;   /* 1: female, 0: male*/ 	int work_years; 	int cadre;    /* 1: is cadre, 0: is not cadre*/ 	int total_eggs, base; 	printf("Please input type(1:female, 0: male) and work years: "); 	scanf_s("%d%d", &type, &work_years); 	while (type != 0 && type != 1) { 		printf("Type input error, please input again!\n"); 		scanf_s("%d", &type); 	} 	printf("Please input check if is cadre(1: yes, 0: no): "); 	scanf_s("%d", &cadre); 	while (cadre != 0 && cadre != 1) { 		printf("Cadre input error, please input again!\n"); 		scanf_s("%d", &cadre); 	} 	if (work_years % 10) 		base = work_years / 10 + 1; 	else 		base = work_years / 10; 	total_eggs = PER_TEN_YEARS * base; 	if (type) 		total_eggs += FEMALE_PER_EGGS * base; 	if (cadre) 		total_eggs += CADRE_PER_EGGS * base; 	printf("The staff should get %d kg eggs!\n", total_eggs); 	system("pause"); 	return 0; } 用VS写的，表示正常输出要这样，谢谢各位大佬

user: user-2
content: #include<stdio.h> #include<stdlib.h>  #define     PER_TEN_YEARS        10 #define     FEMALE_PER_EGGS     2 #define     CADRE_PER_EGGS      5  int main(void) {     int type;   /* 1: female, 0: male*/     int work_years;     int cadre;    /* 1: is cadre, 0: is not cadre*/     int total_eggs, base;      printf("Please input type(1:female, 0: male) and work years: ");     scanf("%d%d", &type, &work_years);     while (type != 0 && type != 1) {         printf("Type input error, please input again!\n");         scanf("%d", &type);     }     printf("Please input check if is cadre(1: yes, 0: no): ");     scanf("%d", &cadre);     while (cadre != 0 && cadre != 1) {         printf("Cadre input error, please input again!\n");         scanf("%d", &cadre);     }      if (work_years % 10)         base = work_years / 10 + 1;     else         base = work_years / 10;     total_eggs = PER_TEN_YEARS * base;      if (type)         total_eggs += FEMALE_PER_EGGS * base;     if (cadre)         total_eggs += CADRE_PER_EGGS * base;     printf("The staff should get %d kg eggs!\n", total_eggs);      return 0;  } 改正上一个的一个Bug.当工作年限正好是10的倍数时，base = work_years  / 10，否则base = work_years  / 10 + 1；

user: user-2
content: #include<stdio.h> #include<stdlib.h>  #define     PER_TEN_YEARS        10 #define     FEMALE_PER_EGGS     2 #define     CADRE_PER_EGGS      5  int main(void) {     int type;   /* 1: female, 0: male*/     int work_years;     int cadre;    /* 1: is cadre, 0: is not cadre*/     int total_eggs, base;      printf("Please input type(1:female, 0: male) and work years: ");     scanf("%d%d", &type, &work_years);     while (type != 0 && type != 1) {         printf("Type input error, please input again!\n");         scanf("%d", &type);     }     printf("Please input check if is cadre(1: yes, 0: no): ");     scanf("%d", &cadre);     while (cadre != 0 && cadre != 1) {         printf("Cadre input error, please input again!\n");         scanf("%d", &cadre);     }      base = work_years / 10 + 1;     total_eggs = PER_TEN_YEARS * base;      if (type)         total_eggs += FEMALE_PER_EGGS * base;     if (cadre)         total_eggs += CADRE_PER_EGGS * base;     printf("The staff should get %d kg eggs!\n", total_eggs);      return 0;  } 参考一下吧