为什么m = 9呢?# includeint main(void){int x;int i = 3;x = ((i++)
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/11/07 17:00:17
为什么m = 9呢?
# include
int main(void)
{
int x;
int i = 3;
x = ((i++),(i++),(i++));
printf("x=%d,i=%d\n",x,i);
int m;
int n = 3;
m = (n++)+(n++)+(n++);
printf("m=%d,n=%d\n",m,n);
return 0;
}
x=5,i=6
m=9,n=6
Press any key to continue
# include
int main(void)
{
int x;
int i = 3;
x = ((i++),(i++),(i++));
printf("x=%d,i=%d\n",x,i);
int m;
int n = 3;
m = (n++)+(n++)+(n++);
printf("m=%d,n=%d\n",m,n);
return 0;
}
x=5,i=6
m=9,n=6
Press any key to continue
n的++在后面.先运算.再加
再问: 好吧,就承认你说的是先运算再加,就是 : m = 3+3+3 , m = 9; 如果是这样子的话,难道三次n++都累积到最后再统一加吗? 请问是这个样子吗??
再问: 好吧,就承认你说的是先运算再加,就是 : m = 3+3+3 , m = 9; 如果是这样子的话,难道三次n++都累积到最后再统一加吗? 请问是这个样子吗??
为什么m = 9呢?# includeint main(void){int x;int i = 3;x = ((i++)
#includeint main(void){int x,y,t,n,flag=1,s,i;while( scanf("
#includeint f(int a);void main(){\x05int i=5,a;\x05a=i++==--
#includeint a(int x);int b(int y);int main(){int m,n;n=6;m=a
一个简单的程序题#includeint main(void){int x=20;printf("%d",0
void main() {int x,i,n=0; for(x=100;i
Void main (){ int i ,x ,y ;Scamf (“%d”,&x );If ( _____) y=x+
#include void fun (int,int); void main (void) { int i,j,x,y,
#include #define M 20; void main() { int i,j,k,p,t,n=0; int
#include void main(){int k1=1;int k2=2;int k3=3;int x=15;if(
# include void p(int *x,int y){ ++*x; y=y+2; } void main() {
#include void func(int b) { int a; a=b;b=10;} void main() {i