请问一下我哪里出错了,c语言编写 5

/*Program2.5Calculationswithcookies*/#include<stdio.h>intmain(void){intcookies=5;intc... /*Program 2.5 Calculations with cookies*/
#include<stdio.h>

int main(void)
{
int cookies = 5;
int cookie_calories = 125; //Calories per cookie
int total_eaton = 0; //Total cookies eaten

int eaten = 2;
cookies = cookies - eaten; //Subtract number eaten from cookies
total_eaten = total_eaten + eaten;
printf("\nI have %d cookies. There are %d cookies left", eaten, cookies);

//New value for cookies eaten
eaten = 3; //Subtract number eaten from cookies
cookies = cookies - eaten;
total_eaten = total_eaten + eaten;
printf("\nI have eaten %d more. Now there are %d cookies left\n", eaten, cookies);
printf("\nTotal energy consumed is %d calcries.\n", total_eaten*cookie_calories);
return 0;
}
编译的时候说total_eaten = total_eaten + eaten; 这个undeclared
可是我看好像没有啥不对的呀
哦,抱歉,我知道了,麻蛋....低级错误

打错字母了orz
展开
 我来答
wanglixin1001
2015-08-28 · TA获得超过4173个赞
知道大有可为答主
回答量:1758
采纳率:80%
帮助的人:863万
展开全部
int total_eaton = 0;这里打错了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式