自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (7)
  • 收藏
  • 关注

原创 习题4.1游泳池改造

/*在一圆形游泳池周围建一圆形过道,并在过道周围安上栅栏。栅栏每米价格为35元,过道每平方米价格为20元。过道宽度为3米。游泳池半径有键盘输入。求过道和栅栏的造价 */#include using namespace std; const float PI=3.1415926;const float FENCE_PRICE=35;//每米栅栏的价格 const float CON

2014-10-29 20:55:08 1183

原创 构造函数和析构函数

一.构造函数作用:zai'dui

2014-10-29 19:33:14 333

原创 类与对象

数据+函数(行为或功能)

2014-10-29 19:05:15 264

原创 习题3.6求两整数的最大公约数和最小公倍数

/*如果有一个自然数a能被自然数b整除,则称a为b的倍数,b为a的约数最大公约数:指两个或多个整数共有约数中最大的一个辗转相除法(欧几里德算法)例如,求(319,377):∵ 319÷377=0(余319)∴(319,377)=(377,319);∵ 377÷319=1(余58)∴(377,319)=(319,58);∵ 319÷58=5(余29),∴ (319,58)=(5

2014-10-29 18:59:07 871

原创 习题3.5求角度的正弦值

#include #include using namespace std; const double PI=3.1415926535879;int main() { double angle; cout<<"请输入角度"<<endl; cin>>angle; double radian=angle*PI/180; cout<<"sin("<<angle<<")="<<(in

2014-10-22 21:33:17 1182

原创 习题3.4求n!(递归)

using namespace std;/*计算n的阶乘*/unsigned int fac(unsigned int n){ unsigned int sum=n; while(--n) { sum*=n; } return sum;} int main() { unsigned int n; cout<<"请输入n"<<endl; cin>>n; cout<<f

2014-10-22 20:58:43 401

原创 习题3.3投骰子的随机游戏

/*题目:每个骰子有六面,点数分别为1,2,3,4,5,6。游戏者在开始输入一个无符号整数,作为产生随机数的种子。每次投两次骰子,第一轮如果和数为7或11则为胜,游戏结束;和数为2,3或12则为败,游戏结束;和数若为其他数则将此值作为自己的点数,继续第二轮,第三轮···直至和数等于点数,则取胜,或出现和数为7,则为败 *///系统函数int rand(void)的功能是产生一个伪随机数,

2014-10-22 20:47:20 2346

原创 习题3.2回文数

/*题目:寻找11~999之间的数n,它满足n,n^2,n^3均为回文数 */#include using namespace std; /*判断是否为回文数*///按照反序重新构建新的数,与原数比较是否相等bool symm(unsigned int n){ unsigned int i=n; unsigned int m=0; while(i) { m=10*m

2014-10-22 20:20:53 564

原创 习题3.1二进制转为十进制

/*题目:输入一个八位的二进制数,将其转为十进制数输出 *//*分析:例:(00001101)2=0*2^7+0*2^6+0*2^5+0*2^4+1*2^3+1*2^2+0*2^1+1*2^0*/ #include using namespace std;int power(int x,int n){ int value=1; while(n--) { value*=

2014-10-22 20:01:02 2781

原创 函数

将相对独立经常使用的功能抽象为函数,在使用时

2014-10-22 19:53:26 368

原创 习题1.4九九乘法表

/*1*1=11*2=2 2*2=41*3=3 2*3=6 3*3=91*4=4 2*4=8 3*4=12 4*4=161*5=5 2*5=10 3*5=15 4*5=20 5*5=251*6=6 2*6=12 3*6=18 4*6=24 5*6=30 6*6=361*7=7 2*7=14 3*7=21 4*7=28 5*7=35 6*7=42 7*7=491*8=

2014-10-15 17:45:27 500

原创 习题1.3从五色球中取三色球的取法

/*题目口袋中有红,黄,蓝,白,黑5种颜色的求若干。每次从口袋中取出3个不同颜色的球,问有多少种取法*/#include using namespace std; int main() { int total=0; for(int one=0;one<5;one++) { for(int two=0;two<5;two++) { if(one!=two) {

2014-10-15 13:45:26 1280

原创 习题1.2找出1~100中的质数(穷举法)

/*找出1~100中的质数(穷举法) */#include #includeusing namespace std; int main() { for(int number=2;number<=100;number++) { int i=2; for(;i<=(int)sqrt(number);i++) { if(number%i==0) { bre

2014-10-15 10:45:12 5032

原创 习题1.1闰年判断

/*闰年能被4整除却不能被100整除或能被400整除 ((year%4==0)&(year%100!=0))|(year%400==0)*/#include using namespace std; int main() { unsigned int year; cout<<"please enter the year"<<endl; cin>>year; if(((year%

2014-10-15 10:35:28 426

原创 cin cout

先看最简单的一个例子,熟悉一下#include //#include为 预处理指令;文件iostream中声明了程序所需要的输入输出操作的有关信息using namespace std;//using namespace是针对命名空间的指令int main() { string pri; cin>>pri;//cin是一个输入流对象,输入操作由操作符“>>”来表示 cout<<p

2014-10-14 20:22:42 765

原创 Dev C++下载

Dev C++历史版本下载:http://sourceforge.net/projects/orwelldevcpp/files/Setup%20Releases/

2014-10-09 16:03:15 4165

mat格式的MNIST数据

因matlab无法直接读取直接下载的MNIST数据格式,故写了一个matlab程序将数据读取后存储为.mat格式 train_images - 60000个训练集,大小为28*28*60000 train_labels - 60000个标签,大小为60000*1 test_images - 10000个训练集,大小为28*28*10000 test_labels - 10000个标签,大小为10000*1

2019-03-04

MNIST手写数字数据库

MNIST手写数字图像数据库 60000个训练集,10000个测试集,灰度图,大小均为为28*28 train-images-idx3-ubyte.gz: training set images (9912422 bytes) train-labels-idx1-ubyte.gz: training set labels (28881 bytes) t10k-images-idx3-ubyte.gz: test set images (1648877 bytes) t10k-labels-idx1-ubyte.gz: test set labels (4542 bytes)

2019-03-04

Normalized Brodatz Texture

The Normalized Brodatz Texture (NBT) database is an improvement of the Brodatz texture database using a normalization process that eliminated the grayscale background effect.

2019-02-25

Original Brodatz Texture

The 112 texture images given in the Brodatz album have different background intensities.

2019-02-25

stm32f10x_fw_archive

stm32固件库stm32f10x_fw_archive

2014-10-26

高质量C++编程指南

这是林锐博士在编写了很多代码后的领悟与感想。拜读后让我感慨颇多,因此分享出来,希望对大家有帮助。

2014-08-02

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除