C++入门经典-例3.16-使用do-while循环进行计算
1:代码如下:
// 3.16.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include <iostream> using namespace std; void main() { int i=0,j=0; cout << "before do_while j=" << j << endl; do { j++; }while(i>1); cout << " after do_while j=" << j << endl; }
运行结果:
本博文由Leon Zhang原创,若转载,请注明出处。