循环控制语句练习

一、

 1.int a = 0;

  scanf("%d", &a);

  scanf中要加&的原因:scanf不在main函数中,即内存地址不同

  不加&,scanf只是改变scanf中的a的值,对main中a无影响

  加&指向a的地址,才能改变main中a的值

循环控制语句练习

二、

逗号表达式 while(a, b, c, d)=while(d)

int i = 10;

while (a = 20, b = 30, i < 20){

//

}

可以执行,相当于while(i < 20){

 

}

while (i < 20, a = 20, b = 30){

//死循环

}

posted @ 2018-07-17 17:24 健泽 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2021-09-01
  • 2021-11-15
  • 2021-10-18
  • 2022-01-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-12-23
猜你喜欢
  • 2021-09-20
  • 2021-11-16
  • 2021-03-31
  • 2021-08-17
  • 2022-03-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案