当前位置:网站首页>Syntax basics (variables, input and output, expressions and sequential statement completion)
Syntax basics (variables, input and output, expressions and sequential statement completion)
2022-08-05 02:45:00 【attack siege lion】

1.A+B
输入两个整数,求这两个整数的和是多少.
输入格式
输入两个整数A,BA,B,用空格隔开
输出格式
输出一个整数,表示这两个数的和
数据范围
0≤A,B≤1080≤A,B≤108
样例输入:
3 4
样例输出:
7
#include<iostream>
using namespace std;
int a,b,c ;
int main(){
cin>>a>>b>>c;
c=a+b;
cout<<c<<endl;
return 0;
}
608.差
读取四个整数 A,B,C,DA,B,C,D,并计算 (A×B−C×D)(A×B−C×D) 的值.
输入格式
输入共四行,第一行包含整数 AA,第二行包含整数 BB,第三行包含整数 CC,第四行包含整数 DD.
输出格式
输出格式为 DIFERENCA = X,其中 XX 为 (A×B−C×D)(A×B−C×D) 的结果.
数据范围
−10000≤A,B,C,D≤10000−10000≤A,B,C,D≤10000
输入样例:
5
6
7
8
输出样例:
DIFERENCA = -26
#include<cstdio>
using namespace std;
int A,B,C,D;
int main(){
scanf("%d%d%d%d",&A,&B,&C,&D);
printf("DIFERENCA = %d\n",A*B-C*D);
return 0;
}
604. 圆的面积
计算圆的面积的公式定义为 A=πR2A=πR2.
请利用这个公式计算所给圆的面积.
ππ 的取值为 3.141593.14159.
输入格式
输入包含一个浮点数,为圆的半径 RR.
输出格式
输出格式为 A=X,其中 XX 为圆的面积,用浮点数表示,保留四位小数.
数据范围
0<R<10000.000<R<10000.00
输入样例:
2.00
输出样例:
A=12.5664
#include<cstdio>
using namespace std;
int main(){
double PI=3.14159;
double R;
scanf("%lf",&R);
printf("A=%.4lf",PI*R*R);
}
606. 平均数1
读取两个浮点数 AA 和 BB 的值,对应于两个学生的成绩.
请你计算学生的平均分,其中 AA 的成绩的权重为 3.53.5,BB 的成绩的权重为 7.57.5.
成绩的取值范围在 00 到 1010 之间,且均保留一位小数.
输入格式
输入占两行,每行包含一个浮点数,第一行表示 AA,第二行表示 BB.
输出格式
输出格式为 MEDIA = X,其中 XX 为平均分,结果保留五位小数.
数据范围
0≤A,B≤10.00≤A,B≤10.0
输入样例:
5.0
7.1
输出样例:
MEDIA = 6.43182
#include<cstdio>
using namespace std;
float A,B;
int main(){
scanf("%f%f",&A,&B);
printf("MEDIA = %.5f",(A*3.5+B*7.5)/11);
}
3 4
样例输出:
7
#include<iostream>
using namespace std;
int a,b,c ;
int main(){
cin>>a>>b>>c;
c=a+b;
cout<<c<<endl;
return 0;
}
1 学如逆水行舟,不进则退
边栏推荐
- 1527. Patients suffering from a disease
- Cloud Native (32) | Introduction to Platform Storage System in Kubernetes
- leetcode-对称二叉树
- Error: Not a signal or slot declaration
- [LeetCode Brush Questions] - Sum of Numbers topic (more topics to be added)
- [深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
- [机缘参悟-60]:《兵者,诡道也》-2-孙子兵法解读
- 剑指offer专项突击版第20天
- The 22-07-31 weeks summary
- tree table lookup
猜你喜欢

Common hardware delays

腾讯云【Hiflow】新时代自动化工具

DAY23:命令执行&代码执行漏洞

QT MV\MVC结构

01 【前言 基础使用 核心概念】

常见的硬件延迟

nodeJs--封装路由

2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。

Cloud Native (32) | Introduction to Platform Storage System in Kubernetes
![[ROS] (10) ROS Communication - Service Communication](/img/4d/4657f24bd7809abb4bdc4b418076f7.png)
[ROS] (10) ROS Communication - Service Communication
随机推荐
select tag custom style
Regular expression to match a certain string in the middle
shell语句修改txt文件或者sh文件
LeetCode使用最小花费爬楼梯----dp问题
02 [Development Server Resource Module]
Semi-Decentralized Federated Learning for Cooperative D2D Local Model Aggregation
22-07-31周总结
人人都在说的数据中台,你需要关注的核心特点是什么?
Data storage practice based on left-order traversal
[ROS] (10) ROS Communication - Service Communication
Syntax basics (variables, input and output, expressions and sequential statements)
C学生管理系统 据学号查找学生节点
[深入研究4G/5G/6G专题-51]: URLLC-16-《3GPP URLLC相关协议、规范、技术原理深度解读》-11-高可靠性技术-2-链路自适应增强(根据无线链路状态动态选择高可靠性MCS)
2022-08-04:输入:去重数组arr,里面的数只包含0~9。limit,一个数字。 返回:要求比limit小的情况下,能够用arr拼出来的最大数字。 来自字节。
常见的硬件延迟
Cloud Native (32) | Introduction to Platform Storage System in Kubernetes
Industry case | insurance companies of the world's top 500 construction standards can be used to drive the business analysis system
Programmer's Tanabata Romantic Moment
正则表达式,匹配中间的某一段字符串
leetcode-对称二叉树