C语言麻烦帮我调试一下

来源:百度知道 编辑:UC知道 时间:2024/06/20 11:41:26
#include "stdafx.h"
#include <iostream.h>
void main()
{
int a=1,b=2,c=3;
cout<<"a="<<a<<"\t"<<"b="<<b<<"\t"<<"c="<<c<<endl;
{
int b=4,c=5;
cout<<"a="<<a<<"\t"<<"b="<<b<<"\t"<<"c="<<c<<endl;
a=b;
{
int c=b;
cout<<"a="<<a<<"\t"<<"b="<<b<<"\t"<<"c="<<c<<endl;
}
cout<<"a="<<a<<"\t"<<"b="<<b<<"\t"<<"c="<<c<<endl;
cout<<"a="<<a<<"\t"<<"b="<<b<<"\t"<<&qu

可以 过 第二个程序你要注意 由除法对特定要求来说 要是都要int型的 不用改 要是要求小数点后的精度 要改为float 或double

很遗憾的告诉你!是错的
e:\vc++临时作业\lzfeng\a1.cpp(1) : fatal error C1083: Cannot open include file: 'stdafx.h': No such file or directory
执行 cl.exe 时出错.

a1.obj - 1 error(s), 0 warning(s)

编译、组建和执行都没问题的
第一题结果为
a=1 b=2 c=3
a=1 b=4 c=5
a=4 b=4 c=4
a=4 b=4 c=5
a=4 b=4 c=5
第二题为
i=3
2
u=23
v=-1
27

你白痴啊,这都不懂!