编程计算100以内偶数的和 C++

qq.zip #include <iostream> using namespace std; int main() { int a=0; for(int i=0;i<=100;i=i+2) { cout<<i; a=a+i; if(i<100) ...
点亮灯 发布于 

今天星期几 标准写法 C++

练习今天星期几.rar #include<iostream> using namespace std; int main() { int a; cout << "请输入星期几(1-7的数字,1表示星期一,7表示星期日):"; cin >> a; switch (a) { ...
点亮灯 发布于 

输入你的生日,计算你已经活了多少天 C++

活了多少天.rar #include <iostream> #include <ctime> #include <string> using namespace std; // 检查是否为闰年 bool isLeapYear(int year) { if ((year % 4 == 0 && y...
点亮灯 发布于 

防忽悠热线 C++

cwitch.rar #include<iostream> using namespace std; int main() { //1、准备变量 int xuanze; //2、录入数据 cout<<"\t*** 这里是防忽悠热线 ***\t\n"<<endl; cout<<"有人卖拐请按1"&l...
点亮灯 发布于 

查全年天数和指定月天数 C++

#include<iostream> //引入iostream库,才能使用输入输出流,cin和cout using namespace std; //引入 std 命名空间 int main() { int nian,yue,ri; cout <<"请输入年份:"; cin>>nian; cout <<...
点亮灯 发布于 

C++ 写的程序 显示针对的月份 的天数 C++

月份天数.rar #include<iostream> using namespace std; int main () { int a,b; cout<<"查询月份天数\n\n请输入年份"; cin>>b; cout<<"请输入月份"; cin>>a; cout&l...
点亮灯 发布于 

将一个五位数转换成倒序的新五位数 C++

将一个五位数转换成倒序的新五位数,如:12345输出为54321 #include<iostream> using namespace std; int main (){ int a,b,c,d,e,f; cout<<"输入五位数\n"; cin>>a; b=a %10; c=a/1...
点亮灯 发布于 

Δ=b^2-4ac C++编写的一元二次议程判断式 C++

判别式.rar #include <iostream> using namespace std; int main(){ double a,b,c; double x,y; double zhi; cout<<"判别式::Δ=b^2-4ac\n"; cout<<"ax^2+bx+...
点亮灯 发布于 
点亮灯 发布于 

第一个小游戏-剪刀石头布(随机数) C++

剪刀石头布.rar #include<iostream> #include<cstdlib> #include<ctime> using namespace std; int main () { int shu1; int shu2; /*************/ cout<<"\t\t\t********...
点亮灯 发布于