编写程序,提示用户输入两个整数,打印出这两个整数所指定的范围内的所有整数。

#include <iostream> int main() { int v1, v2 = 0; std::cout << "Please enter two numbers: " << std::endl; std::cin >> v1 >> v2; std::cout<<"Integraters between v1 and v2 are "<<std::endl; while (v1 < v2) { std::cout << v1 << std::endl; ++v1; if (v1==v2) break; } while (v1 > v2) { s...
c++ | 2015-01-23 23:12 | 阅读 1285 次 | 评论 0 条
浏览1285次
文章分类
文章归档
最新评论