C++实验报告(20200623051847)

  • 格式:docx
  • 大小:64.67 KB
  • 文档页数:11
Pa 1
radius:一2 li igli:1
The uolune is:12-5664
C+
实验报告
错误!未找到引用
学号:源。姓 Nhomakorabea名:
错误!未找到引用
源。
提交日期:
2010-06-06错误!
未找到引用源。

绩:
东北大学秦皇岛分校
■ ■ ■ ■ ■ ■
实验一:数据类型与表达式
实验目的:
1熟悉并学习使用C++程序编译平台VC6.0;
2、 掌握如何在编译平台下编辑、编译、连接和运行一个简单的C++程序;
3、掌握C++语言基础数据类型,熟悉变量定义和赋值方法;
4、学会使用C++算术运算符和算术表达式;
题目
实验代码:
#in elude <iostream>
using n amespace std;
#define PI 3.14159
int mai n()
{
int radius,high;
double volume;
return 0;
实验结果:
可C,Use诂'iving\Deskto真②■C
■JC :\ Use rs\wi n g- Peskto p'-.M W' .C
rplease input tuo number:5 8
dins::8
rriie volume is:628 _318
please input tvo nunher:
cout<<"please in put two nu mber:"<<e ndl;
cin>> radius>>high;
volume=PI*radius*radius*high;
cout<<"radius:"<<radius<<"high:"<<high<<e ndl;
cout<<"The volume is:"<<volume<<e ndl;