当前位置:网站首页>Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
Summary of error prone knowledge points: Calculation of define s (x) 3*x*x+1.
2022-07-03 12:33:00 【Android little white star】
This is a macro definition with parameters , Usually, the macro parameters in the macro content text are replaced with text .
Let's use this to write an example for calculation .
#define SUM(x) 3*x*x+1
int main()
{
int i=5;
int j=8;
printf("%d\n",SUM(i+j));
}
The answer from the computer is 64.
My wrong idea at the beginning is :3*(5+8)*(5+8)+1.
But the difference between the calculated value and the actual value .
The right thinking is :SUM Don't put parentheses Take it with you , Only the formula Take it to .3*5+8*5+8+1.
The calculated answer is exactly the same as the actual answer .
边栏推荐
- (构造笔记)从类、API、框架三个层面学习如何设计可复用软件实体的具体技术
- Redis
- Display time with message interval of more than 1 minute in wechat applet discussion area
- Fundamentals of concurrent programming (III)
- Use of atomicinteger
- elastic_ L02_ install
- What is more elegant for flutter to log out and confirm again?
- temp
- 1-1 token
- Eureka自我保护
猜你喜欢

PHP export word method (one MHT)

使用BLoC 构建 Flutter的页面实例

Wechat applet - basic content
![Sword finger offer03 Repeated numbers in the array [simple]](/img/cf/c1ad2f2a45560b674b5b8c11fed244.png)
Sword finger offer03 Repeated numbers in the array [simple]

Why can't my MySQL container start

公纵号发送提示信息(用户微服务--消息微服务)

If you can't learn, you have to learn. Jetpack compose writes an im app (I)

Implement verification code verification

2.7 overview of livedata knowledge points

Integer int compare size
随机推荐
(构造笔记)ADT与OOP
剑指Offer10- I. 斐波那契数列
temp
[combinatorics] permutation and combination (summary of permutation and combination content | selection problem | set permutation | set combination)
[combinatorics] permutation and combination (example of permutation and combination)
实现验证码验证
Pki/ca and digital certificate
(construction notes) ADT and OOP
[embedded] - Introduction to four memory areas
Wechat applet - basic content
Atomic atomic operation
Recovery of website address and method of Amazon account login two-step verification failure caused by mobile phone number becoming empty
【嵌入式】---- 内存四区介绍
PHP export word method (phpword)
regular expression
temp
2.7 overview of livedata knowledge points
What is more elegant for flutter to log out and confirm again?
网上炒股开户安不安全?谁给回答一下
Sword finger offer03 Repeated numbers in the array [simple]