int x =10在这个位置为什么fn1()输出的不是10而是50
#include <stdio.h>
int x = 77;
void fn1()
{
printf("fn1(): x=%d\n", x);
}
int main()
{
if(x>0)
{
x = 100;
x /= 2;
printf("if语句内, x=%d\n", x);
}
printf("main方法内, x=%d\n", x); int x = 10;
fn1();
return 0;
}
#include <stdio.h>
int x = 77;
void fn1()
{
printf("fn1(): x=%d\n", x);
}
int main()
{
if(x>0)
{
x = 100;
x /= 2;
printf("if语句内, x=%d\n", x);
}
printf("main方法内, x=%d\n", x); int x = 10;
fn1();
return 0;
}
2023-11-01
举报