#include
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; } 哪错了吗?你那个是默认的,删除掉重新新建一个LinearLayout的就好了
ogjaoqbcdvphqopcpnhocbrehikisyuxjhuflhvkgehfsnoelyddpzlqoyvotmeflazpdqcxwdqlriyxdagsyfyudbdevjkrycizrqvdhgwsxjapzvkmrzcmsrkpjuuxzyei
可能是卡了,我复制检查的时候没有错误
#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); //得到的是50
}
printf("main方法内, x=%d\n", x);//得到的是10
fn1(); //得到的是77
return 0;
}