当前位置:网站首页>Exercise 8-2 calculate the sum and difference of two numbers
Exercise 8-2 calculate the sum and difference of two numbers
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
practice 8-2 Calculate the sum and difference of two numbers (10 branch )
This problem requires a simple function to calculate the sum and difference of two input numbers .
Function interface definition :
void sum_diff( float op1, float op2, float *psum, float *pdiff );
among op1 and op2 Are two real numbers entered ,*psum and *pdiff Is the calculated sum and difference .
Sample referee test procedure :
#include <stdio.h>
void sum_diff( float op1, float op2, float *psum, float *pdiff );
int main()
{
float a, b, sum, diff;
scanf("%f %f", &a, &b);
sum_diff(a, b, &sum, &diff);
printf("The sum is %.2f\nThe diff is %.2f\n", sum, diff);
return 0;
}
/* Your code will be embedded here */
sample input :
4 6
sample output :
The sum is 10.00
The diff is -2.00
void sum_diff( float op1, float op2, float *psum, float *pdiff ){
*psum=op1+op2;
*pdiff=op1-op2;
}
边栏推荐
- “又土又穷”的草根高校,凭什么被称为“东北小清华”?
- 金属有机骨架(MOFs)抗肿瘤药载体|PCN-223装载甲硝唑|UiO-66包载盐酸环丙沙星([email protected])
- Global event bus
- QT learning 19 standard dialog box in QT (top)
- Uniapp skills - dom display and hiding
- Selenium browser (1)
- Comprehensive case of MySQL data addition, deletion, modification and query
- Folic acid modified metal organic framework (zif-8) baicalin loaded metal organic framework composite magnetic material (AU- [email
- Fabric. JS document
- Webpage connection database ~ simple implementation of addition, deletion, modification and query complete code
猜你喜欢
[email protected] Nanoparticles) | nano metal organic framework carry"/>Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry

Qt学习18 登录对话框实例分析

Richview trvstyle liststyle list style (bullet number)

Generate directories from web content

Go language web development series 30: gin: grouping by version for routing

Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)

Print. JS -- web page file printing

玖逸云黑免费无加密版本源码

关于回溯问题中的排列问题的思考(LeetCode46题与47题)

核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
随机推荐
Why are grass-roots colleges and universities with "soil and poverty" called "Northeast small Tsinghua"?
Implementation of Muduo asynchronous logging
Doxorubicin loaded on metal organic framework MIL-88 DOX | folic acid modified uio-66-nh2 doxorubicin loaded [email
Go language web development series 28: solve cross domain access of CORS with gin contrib / CORS
Common mixins
JS Part III
项目协作的进度如何推进| 社区征文
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
Depth and breadth first traversal of tree (regardless of binary tree)
QT learning 23 layout manager (II)
Installation impression notes
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
[acnoi2022] guess numbers
交联环糊精金属有机骨架负载甲氨蝶呤缓释微粒|金属-有机多孔材料UiO-66负载黄酮苷类药物|齐岳
How to promote the progress of project collaboration | community essay solicitation
Redis:字符串類型數據的操作命令
Exercise 7-6 count capital consonants
QT learning 22 layout manager (I)
Multi person collaborative data annotation based on Baidu brain easydata from scratch
Common network state detection and analysis tools