摘要: 循环语句: 一般循环结构包含3个部分:循环的初始化、循环条件、循环体 1.while循环(当型循环): 特点:当while()中的条件判断为真时,执行循环,循环体中应该具备改变循环条件的语句,否则循环会一直执行下去。 2.do-while循环(当型循环) 特点:持续执行循环体,直到while()判断 阅读全文
posted @ 2018-11-20 23:36 裏表異体 阅读(375) 评论(0) 推荐(0) 编辑
摘要: 代码: #include<iostream>#include<cmath>using namespace std;int gcd(int, int);int main(){ cout << "用递归方式求最大公约数"; int a, b; cout<<"请输入a和b(>=0):"; cin >> a 阅读全文
posted @ 2018-11-20 20:06 裏表異体 阅读(1705) 评论(0) 推荐(1) 编辑