当前位置:网站首页>Daily question brushing plan-2-13 fingertip life
Daily question brushing plan-2-13 fingertip life
2022-07-06 02:54:00 【Konjak_ Konnyaku】
「 This is my participation 2022 For the first time, the third challenge is 25 God , Check out the activity details : 2022 For the first time, it's a challenge
BC140 KiKi Design class inheritance
describe
KiKi Understand that inheritance can make code reuse , He now defines a base class shape, Private data is coordinate point x,y, Derived from it Rectangle Classes and Circle class , They all have member functions GetArea() Find the area . Derived class Rectangle Class has data : The length and width of the rectangle ; Derived class Circle Class has data : The radius of the circle .Rectangle Class derives square Square class , Define and test . Enter three sets of data , They are the length and width of the rectangle 、 The radius of the circle 、 The side length of a square , Output three groups of data , They are rectangles 、 round 、 The square area . PI by 3.14 Calculation .
Input description :
Enter three lines ,
The first line is the length and width of the rectangle ,
The second line is the radius of the circle ,
The third line is the side length of the square .
Output description :
Three elements , They are rectangles 、 round 、 The square area .
Example 1
Input :
Copy
Output :
Copy
Function knowledge
1. Functions cannot be nested , But you can nest calls
2.printf() : Returns the number of characters printed on the screen , If an error occurs , Return negative
3.scanf() : Returns the number of valid characters successfully read
4. Functions can be accessed in a chain
5. You can use global variables to pass parameters
6. Functions can have no return value
7. The definition of a function can be placed anywhere , The declaration of a function must be placed before the use of the function
- The declaration of a function simply tells the compiler the type of the return value of the function 、 Function name and parameters required by the function , The function definition is to explain how the function is implemented
- Formal parameters are instantiated only when the function is called , To open up memory space
- When passing parameters, whether by value or pointer , All the formal parameters get is a copy of the argument
- Formal parameters are instantiated only when the function is called , To open up memory space
- main The position of the function can be anywhere , Top note, but if you call those functions before the main function , Must be in main The header file that contains the life of the called function or the called function before the function .
- Variables defined in compound statements within a function can only be used in compound statements , Not valid within the scope of this function
- The formal parameters of a function are generally passed by pressing the stack of parameters , The formal parameters in the function are saved in the stack
- Different functions belong to different scopes , Therefore, variables with the same name defined in different functions will not conflict
- Variables defined in functions , It's called a local variable , Local variables can only be used in the functions they define , Variables defined within a function are valid only within the scope of this function
边栏推荐
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 10
- 【 kubernets series】 a Literature Study on the Safe exposure Applications of kubernets Service
- MySQL winter vacation self-study 2022 11 (7)
- 【若依(ruoyi)】启用迷你导航栏
- 【指针训练——八道题】
- 【Unity3D】GUI控件
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
- 07 单件(Singleton)模式
- MySQL learning notes-10-tablespace recycling
- JS regular filtering and adding image prefixes in rich text
猜你喜欢

Solution: attributeerror: 'STR' object has no attribute 'decode‘

4. File modification

RobotFramework入门(三)WebUI自动化之百度搜索

What is the investment value of iFLYTEK, which does not make money?

建模规范:命名规范

GifCam v7.0 极简GIF动画录制工具中文单文件版

Modeling specifications: naming conventions
![[unity3d] GUI control](/img/ef/9de2aa75c67cf825983867a913db74.png)
[unity3d] GUI control
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18](/img/1a/94ef8be5c06c2d1c52fc8ce7f03ea7.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18

Network Security Learning - Web vulnerabilities (Part 1)
随机推荐
Function knowledge points
Apt installation ZABBIX
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 23
原型图设计
【若依(ruoyi)】启用迷你导航栏
淘宝焦点图布局实战
ReferenceError: primordials is not defined错误解决
Atcoder beginer contest 233 (a~d) solution
【若依(ruoyi)】设置主题样式
4. File modification
2345 file shredding, powerful file deletion tool, unbound pure extract version
Maturity of master data management (MDM)
Huawei, H3C, Cisco command comparison, mind map form from the basic, switching, routing three directions [transferred from wechat official account network technology alliance station]
What is the investment value of iFLYTEK, which does not make money?
Yyds dry inventory comparison of several database storage engines
Codeforces 5 questions par jour (1700 chacune) - jour 6
会员积分营销系统操作的时候怎样提升消费者的积极性?
JS regular filtering and adding image prefixes in rich text
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
球面透镜与柱面透镜