如何找到以下程序的错误? 。 [英] How do I find the errors for the below program ? .

查看:60
本文介绍了如何找到以下程序的错误? 。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

查找程序中的错误:

Find the errors in the program:

#include <stdio.h>
#define CUBE(Y) (Y)*(Y)*(Y) ;
#define SQUARE(Y) (Y)*(Y);
int main() 
{ double  Int,y,_y1,2yb,a-b,y3z;
Int Float,char,a,b,c,d,xy@c,qa.b; 
char int,u,_2v,w=t; 
a=2,b=3; 
a+b; 
c=a+b; 
a+b=1; 
b-a==c; 
d=w; 
a=CUBE(d); 
b=SQUARE(d)
u=d+62; 
c=u-1; 
u=’y’; 
_2v=z; 
y3z=CUBE(c);
 y=SQUARE(c);
 _y1=SQUARE(c)*2; 
c=y+u; 
return 0;
}





我的尝试:



我试过找出一些错误。



What I have tried:

I have tried finding out some of the errors.

推荐答案

你想要什么,列表?



抓住你最喜欢的C编译器,并编译它。

它会给你一个列表,这将是非常冗长的。它会忽略风格错误,愚蠢 - 但合法 - 命名的想法,以及大多数代码的实用性缺乏。



但是......我们不会做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。

因此,只要修复它们,您就可以自己动手了...自己尝试一下,你可能会发现它并不像你想象的那么困难!



如果您遇到特定问题,请询问相关问题,我们会尽力提供帮助。但是我们不打算为你做这一切!
What do you want, a list?

Grab your favorite C compiler, and compile it.
It will give you a list, which will be quite lengthy. And it will ignore stylistic errors, stupid - but legal - naming ideas, and the toal lack of usefulness of most of that code.

But ... We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
So as far as fixing them, you are on your own ... Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


为什么你要声明一个名为Int,或2yb或(甚至更糟)ab的双变量?

您实际上认为表达式 Int Float char int 或w = t?



我建议你把它扔掉,给自己一本关于C语言的好学习指南。
Why would you ever declare a double variable with the name Int, or 2yb or (even worse) a-b?
What do you actually think is meant by the expression Int Float, or char int, or w=t?

I suggest you throw this away and get yourself a good study guide on the C language.


我们不做你的家庭工作。

HomeWork不会在乞求别人做你的工作时测试你的技能,它会让你思考并帮助你的老师检查你对你所拥有的课程的理解采取以及你应用它们时遇到的问题。

任何失败都会帮助你的老师发现你的弱点并设定补救措施。

HomeWork问题是你在现实生活中必须解决的问题的简化版本,他们的目的正在学习和练习
We do not do your HomeWork.
HomeWork is not set to test your skills at begging other people to do your work, it is set to make you think and to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them.
Any failure of you will help your teacher spot your weaknesses and set remedial actions.
HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing.


这篇关于如何找到以下程序的错误? 。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆