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;
}
View Code

运行结果:

原文地址:https://www.cnblogs.com/lovemi93/p/7515463.html