C的快速趋向实验 -->
时间:2015-11-24 12:46:36
收藏:0
阅读:284
今天刚学到C的一个新玩法,非常有意思,叫趋向于,协作“-->”,比如说如果要实现一个倒数的程序,我们可以定义一个变量 counter,然后让它趋向于0...
1 #include <stdio.h> 2 3 int main(int argc, char **argv) 4 { 5 int counter = 10; 6 while(counter --> 0) 7 { 8 printf("%d ",counter); 9 } 10 printf("\nhello world\n"); 11 return 0; 12 }
打印输出:
9 8 7 6 5 4 3 2 1 0 hello world
原文:http://www.cnblogs.com/feiqiang/p/4990883.html
评论(0)