C++语言开发示例:04. do while循环
2024-07-14 07:56:43 2025-02-01 20:27:49 李腾 22 次阅读 0 次点赞
dowhile.cpp
#include <iostream>
int main()
{
using namespace std;
int n;
cout << "Enter numbers in the range 1-10 to find ";
cout << "my favorite number\n";
do
{
cin >> n;
} while (n != 7);
cout << "Yes, 7 is my favorite.\n";
}
本文由人工编写,AI优化,请仔细甄别,转载请注明转自www.hylab.cn,原文地址:C++语言开发示例:04. do while循环