++k k++ 在for-loop中的区别 他们是一样的吗?
来源:百度知道 编辑:UC知道 时间:2024/05/22 02:46:52
例子:
#include <stdio.h>
void main(void)
{ int row, col;
int a[5][5];
for(row=0; row < 10 ; row++) for(col=0; col < 10 ; col++)
a[row][col] = 10;
for(row=0; row < 5; ++row)
{ for(col=0; col < 5; ++col)
printf("a[%i][%i] = %i ", row, col, a[row][col]);
printf("\n"); }
}
为什么第一个循环 row++ col++
第二个是 ++row ++col
有什么区别吗?
请详细回答!
#include <stdio.h>
void main(void)
{ int row, col;
int a[5][5];
for(row=0; row < 10 ; row++) for(col=0; col < 10 ; col++)
a[row][col] = 10;
for(row=0; row < 5; ++row)
{ for(col=0; col < 5; ++col)
printf("a[%i][%i] = %i ", row, col, a[row][col]);
printf("\n"); }
}
为什么第一个循环 row++ col++
第二个是 ++row ++col
有什么区别吗?
请详细回答!
不一样的,row++ col++是先使用row的原始值进行运算,然后在+1;
++row ++col是先对row+1,再用加过的值进行运算。
这个程序里没有区别,++row,比row++的效率稍微高点,没什么影响,怎么写都行
k.d.lang Love For Sale
King For One One For K|ng'Z
int i, k; 则for循环语句: for(i=0,k=-1;k=1;i++,k++)的结果
我用的是爱普生的LO-1600KⅢ的打印机,在XP系统上有它的驱动,我装上后为什么连测试页也打不出来呢
15、循环语句FOR K=1 TO 10 STEP 5 NEXT K 循环次数为;
……口服方式 for 白化病人 to 治疗????K
急需 EPSON LQ-1600K III + 驱动程序for WinXP!!!!!!!!!
求gateway T-1616k for XP所有驱动
在网上怎么K歌?
S&K在张家界有卖吗??