标签:c style class blog code java
常见的编程错误:
错误预防技巧:
良好的编程习惯:
C++版本
// Counter-controlled repetition #include <iostream> using namespace std; int main() { int counter = 1; // declare and initialize control variable while(counter <=10) // loop-continuation condition { cout << counter << " "; counter++; } // end while cout << endl; // output a newline return 0; // successful termination } // end main
python版本
# -*- coding: utf-8 -*- """ Created on Sat Jun 07 21:13:07 2014 @author: Administrator """ # Counter-controlled repetition counter = 1 # declare and initialize control variable while(counter <=10): print counter, counter = counter + 1 print # output a newline
计数器控制的while循环(C++/python版),布布扣,bubuko.com
标签:c style class blog code java
原文地址:http://www.cnblogs.com/tmmuyb/p/3775368.html