![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++语言程序设计学习代码
为考研准备,方便巩固复习。
今天也要开心鸭
这个作者很懒,什么都没留下…
展开
-
C++语言程序设计(第四版)郑莉 第2章课后习题代码
#include <iostream> #include <cmath> #include <iomanip> using namespace std; const float PI=3.1416; void hw2_4(){ float a=PI; cout<<a; } enum Color{WHITE,BLACK=100,RED,BLUE,GREEN=300,YELLOW}; void hw2_5(){ int a=BLUE; cout&l原创 2021-07-13 22:59:27 · 258 阅读 · 0 评论 -
C++语言程序设计(第四版)郑莉 第3章案例
C++语言程序设计(第四版)郑莉 书上案例 目前在学习这本书,后面会保持更新。 #include <iostream> #include <cmath> #include <cstdlib> #include <iomanip> using namespace std; //编写一个求x的n次方的函数 //计算x的n次方 double power(double x,int n){ double val=1.0; while(n--){ val*=x原创 2021-07-11 15:04:19 · 251 阅读 · 0 评论 -
C++语言程序设计(第四版)郑莉 第2章案例
C++语言程序设计(第四版)郑莉 书上案例第二章案例 此代码为考研所敲,会保持更新。 第二章案例 #include <iostream> using namespace std; void test2_1(){ cout<<"Hello!"<<endl; cout<<"Welcome to C++!"<<endl; } //输入一个年份判断是否是闰年 void test2_2(){ int year; bool isLeapY原创 2021-07-09 19:21:11 · 154 阅读 · 0 评论