c程序设计基础1-基本数据与表达式
1.1 概述 1.2 C++的字符集与词汇 1.3 C++的基本数据类型与存储形式 1.4 数据对象与访问 1.5 表达式 1.6 数据输入和输出 小结第1章 基本数据与表达式1.1 概述1.1.1 程序设计与程序设计语言 程序设计语言 人指挥计算机工作的工具,是由字、词和语法规则构成的指令系统 程序设计 根据特定的问题,使用某种程序设计语言,设计出计算机执行的指令序列主要完成两方面工作:数据描述 (2) 数据处理 1.1 概述1.1.2 一个简单的C++程序问题:输入圆的半径,求圆的周长和面积 数据描述: 半径,周长,面积均用实型数表示数据处理: 输入半径 r; 计算周长 = 2*π*r ; 计算面积 = π* r2 ; 输出半径,周长,面积;例1-1 方法一,用结构化方法编程,求圆的周长和面积 // count the girth and area of circle#includeiostreamusing namespace std ;int main (){ double r, girth, area ; const double PI = 3.1415 ; cout Please input radius:\n ; cin r ; girth = 2 * PI * r ; area = PI * r * r ; cout radius = r endl ; cout girth = girth endl ; cout area = area endl ;}例1-1 方法一,用结构化方法编程,求圆的周长和面积 // count the girth and area of circle#includeiostreamusing namespace std ;int main (){ double r, girth, area ; const double PI = 3.1415 ; cout Please input radius:\n ; cin r ; girth = 2 * PI * r ; area = PI * r * r ; cout radius = r endl ; cout girth = girth endl ; cout area = area endl ;}数据描述例1-1 方法一,用结构化方法编程,求圆的周长和面积 // count the girth and area of circle#includeiostreamusing namespace std ;int main (){ double r, girth, area ; const double PI = 3.1415 ; cout Please input radius:\n ; cin r ; girth = 2 * PI * r ; area = PI * r * r ; cout radius = r endl ; cout girth = girth endl ; cout area = area endl ;}数据处理例1-1 方法一,用结构化方法编程,求圆的周长和面积 // count the girth and area of circle#includeiostreamusing namespace std ;int main (){ double r, girth, area ; const double PI = 3.1415 ; cout Please input radius:\n ; cin r ; girth = 2 * PI * r ; area = PI * r * r ; cout radius = r endl ; cout girth = girth endl ; cout area = area endl ;}输入数据例1-1 方法一,用结构化方法编程,求圆的周长和面积 // count the girth and area of circle#includeiostreamusing namespace std ;int main (){ double r, girth, area ; const double PI = 3.1415 ; cout Please input radius:\n ; cin r ; girth = 2 * PI * r ; area = PI * r * r ; cout radius = r endl ; cout girth = girth endl ; c
您可能关注的文档
- 7A M1 U3 Yu Garden.ppt
- 7上Uni3task.ppt
- 7下Unit 6 Outdoor funReading1.ppt
- 8B U4 a new newspaper.ppt
- 8B U5 Task.ppt
- 8D report- Jackson reply.doc
- 9Aunit5 period3.ppt
- About the Newspaper.ppt
- Ability_Testing.ppt
- Accounting English (part7).ppt
- 2025年全国演出经纪人员资格认定考试试卷带答案(研优卷).docx
- 2025年全国演出经纪人员资格认定考试试卷完整版.docx
- 2025年全国演出经纪人员资格认定考试试题库及完整答案.docx
- 2025年全国演出经纪人员资格认定考试试卷完美版.docx
- 2025年全国演出经纪人员资格认定考试试卷含答案(实用).docx
- 2025年全国演出经纪人员资格认定考试试卷及答案(各地真题).docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
- 2025年全国演出经纪人员资格认定考试试卷及答案1套.docx
- 2025年下半年四川成都市郫都区面向社会引进公共类事业单位人员2人备考题库最新.docx
- 2025年下半年内江市部分事业单位公开考试招聘工作人员(240人)备考题库附答案.docx
最近下载
- TD_T 1041-2013土地整治工程质量检验与评定规程.pdf
- 中国脑血管疾病分类2015中华医学会神经病学分会、中华医学会神经病学分会脑血管病学组(发布时间:2017-03).pdf VIP
- 工厂节能降耗培训课件.pptx
- 节约用水介绍课件.pptx
- 2026春新版人教版八年级下册单词默写单词表(全)U1-U8英译中.docx
- 水环境治理与净化项目背景概述,包括对项目的详细描述,包括规模、位置和设计特点.docx VIP
- 风力发电项目背景概述,包括对项目的详细描述,包括规模、位置和设计特点.docx VIP
- 《大魔法书》(Grand Grimoire).pdf VIP
- 山东省青岛市李沧区2024-2025学年八年级上学期期末考试数学试卷 (原卷版+解析版).docx VIP
- 临床医学考试题目及答案.doc VIP
原创力文档

文档评论(0)