#include <stdio.h>
int x = 77;
void fn1()
{
printf("fn1(): x=%d\n", x);
}
int main()
{
int x = 10;
if(x>0)
{
x = 100;/*此处加个什么变量类型就能将main方法内的x输出10???????????????????????*/
x /= 2;
printf("if语句内, x=%d\n", x);
}
printf("main方法内, x=%d\n", x);
fn1();
return 0;
1 回答
陈落
TA贡献1条经验 获得超0个赞
#include <stdio.h>
int x = 77;
void fn1()
{
printf("fn1(): x=%d\n", x);
}
int main()
{
int x = 10;
if(x>0)
{
int x = 100;
x /= 2;
printf("if语句内, x=%d\n", x);
}
printf("main方法内, x=%d\n", x);
fn1();
return 0;
- 1 回答
- 0 关注
- 1026 浏览
添加回答
举报
0/150
提交
取消