Sample 5.15:dowhile.cpp

来源:互联网 发布:2017淘宝卖什么好卖呢 编辑:程序博客网 时间:2024/06/08 03:49
#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";    return 0;}

0 0