排序
C++演奏起风了音乐
相信大家对编程这块儿有所了解,但是大家通常拿编程做软件开发,网站开发,其实他也可以做音乐,下面我们将会以“起风了”音乐作为实例 准备工具: 一台Windows电脑。 使用Visual Studio 2019(...
心算游戏
#include<bits/stdc++.h> using namespace std; int main() { int x,a,b,c; bool y; cin>>x; for (int i=0;i<x;i++) { srand(time(0)); a=rand()%90+10; b=rand()%90+10; cout &...
向上下取整(C++)
#include <iostream> using namespace std; int main() { //向上取整 float x = 4.6; int n = ceil(x); cout << n << endl; //向下取整 cout << floor(x)<<endl;...
平闰年判断C++程序
#include <iostream> using namespace std; int main() { int year=0; while (true) { cout << '请输入年份:'; cin >> year; if (year<=0) { cout << '输入数据非...
C++程序实例
//<eg>给定一个字符,用它构造一个对角线长5个字符,倾斜放置的菱形。 #include <iostream> using namespace std; int main() { char a; while (true) { cout << '请输入任意...
数据分段问题(C++)
//数据分段问题 //某市的士起步价为8元,可以行驶3KM,3KM后按每公里1.6元计算。 //程序要求:输入的士的公里数,请计算顾客需要付费多少元? #include <iostream> using namespace std; ...
鸡兔同笼问题(C++)
//鸡兔同笼问题 //某车棚存有自行车和三轮车共65辆,他们的轮子合计为150个。 //需求:求该车棚内存的自行车和三轮车分别多少? #include <iostream> using namespace std; int main() { ...
C++函数学习
//C++函数学习 //任意输入5个数相加,结果输出 #include <iostream> using namespace std; int add(int a, int b, int c, int d, int e) { return a + b + c + d + e; } int main() { int...