-
one
实验1 C++基础编程
实验目的
? 掌握VC++ 6.0进行程序设计的基本步骤。
? 学会在VC++ 6.0环境下进行简单C++程序设计。
? 掌握new和delete的用法。
? 熟练使用string类处理字符串。
? 重点掌握函数的参数传递方式、函数重载、函数默认值的实现。
实验学时
本次实验需要2个学时。
实验要求
? 实验上机之前,根据实验内容要求,自行设计编写程序,完成预习报告。
? 实验上机时调试并修正程序。
? 当次上机结束前分析错误原因并给出实验结论,提交实验报告。
实验内容
1.基础部分
(1)动态分配保存10个成绩数组的存储空间,并对成绩进行输入,求出最高分并输出,用new和delete。
{
double*pd=new double [10];
double k;
for(int i=0;i<10;i++)
cin>>pd[i];
for(int j=0;j<9;j++)
{
if(pd[j]>pd[j+1])
{
k=pd[j];
pd[j]=pd[j+1];
pd[j+1]=k;
}
if(j==8)
cout<<pd[j+1]<<endl;
}
system("pause");
return 0;
}
(2).定义函数,实现两个变量的交换(用传递指针和传递引用的方式分别实现),并对比区别。
(4).上述第(3)题,如果希望给形参默认值,如a=1,b=2,c=3,该如何修改和如何调用?(Experiment 1 C++ Basic Programming Experimental purpose Grasp the basic steps of VC++ 6.0 programming. Learn to design simple C++ programs in the environment of VC++ 6.0. Master the usage of new and delete. Proficiency in string class processing. Emphasis is laid on how to transfer function parameters, how to overload function and how to realize default value of function. Experimental hours This experiment needs two hours. Experimental requirements Before the experiment is put on the computer, according to the requirement of the experiment content, the program is designed and written by oneself, and the preview report is completed. Debug and correct the program when the experiment is on the computer.)
- 2019-05-01 14:56:42下载
- 积分:1
-
FM25CL64
STM32 SPI读写FM25CL64铁电存储器,程序为103RBT6单片机读写代码,包括SPI初始化、字节发送接收代码、FM25CL64读写代码(STM32 SPI read/write FM25CL64 ferroelectric memory, the application for 103 rbt6 microcontroller, speaking, reading and writing code, including the SPI initialization code byte code to send and receive FM25CL64, speaking, reading and writing
)
- 2020-06-27 02:20:02下载
- 积分:1
-
WpfApplication2
WPF 密码控件提示文字password 水印效果(WPF password control hint text watermark effect)
- 2018-05-11 16:16:43下载
- 积分:1
-
chenggongchengxu
rgb to HSV,很有用,调试成功,可以应用(rgb to HSV,#include "stdafx.h"
#include <iostream.h>
void main(float R, float G, float B, float& H, float& S, float&V)
{
// r,g,b values are from 0 to 1
// h = [0,360], s = [0,1], v = [0,1]
// if s == 0, then h =-1 (undefined)
float min, max, delta,tmp
tmp = R>G?G:R
min = tmp>B?B:tmp
tmp = R>G?R:G
max = tmp>B?tmp:B
V = max // v
delta = max- min
if( max != 0 )
S = delta/max // s
else
{
// r = g = b = 0 // s = 0, v is undefined
S = 0
H = 0
return
}
if (delta == 0){
H = 0
return
}
else if(R == max){
if (G >= B)
H = (G- B)/delta // between yellow & magenta
else
H = (G- B)/delta+ 6
}
else if( G == max )
H = 2+ ( B- R )/delta // between cyan & yellow
else if (B == ma)
- 2011-12-02 10:09:24下载
- 积分:1
-
DITREG
简单的数字识别系统。基于vc编写的,对于规范的宋体字体可以很好识别(Simple digital identification system. Based on vc prepared for the standard Times New Roman font can be well identified)
- 2020-10-08 10:07:36下载
- 积分:1
-
FT_Prog_v1.5
FT2232H存储器配置工具,可更改EEPROM内容。(FT2232H memory configuration tool, change the EEPROM content.)
- 2021-01-16 16:38:44下载
- 积分:1
-
Arduino 远程遥控
实现硬件与上位机的快速网络传输
- 2022-01-25 22:20:54下载
- 积分:1
-
StereoVision-master
双目相机的三维重建程序,包含两个相机的标定,极线校正,图像匹配,三维重建(Binocular camera reconstruction program, including calibration of the two cameras, pole line correction, image matching, 3D reconstruction)
- 2021-04-25 22:48:45下载
- 积分:1
-
C++图片信息隐写(可运行)
说明: 在图片末端隐藏信息,利用C++语言编程实现。(Picture information steganography.)
- 2020-06-17 06:20:02下载
- 积分:1
-
BD预编码仿真代码
BD预编码技术可以理解为在各个用户端分别设计一个预编码矩阵,下面介绍具体的实现过程:发送端设置为M根天线,共有K个用户,N为接收端天线数目,且满足 M ≥ KN,使用BD预编码来实现信息的传输,这样能够降低多用户之间的干扰。
- 2022-04-24 06:19:24下载
- 积分:1