#include <stdio.h>
int main()
{
int x = 10;
int y = 10;
x =x * 2;
y *= 2;
printf("x=%d\n", x);
printf("y=%d\n", y);
return 0;
}
#include <stdio.h>
int main()
{
int x = 10;
int y = 10;
x *= 2;
y *= 2;
printf("x=%d\n", x);
printf("y=%d\n", y);
return 0;
}
x*=2和x=x*2是等价的,两种写法,效果一模一样。