当前位置:网站首页>Solution to the program design of the sequence structure of one book (Chapter 1)
Solution to the program design of the sequence structure of one book (Chapter 1)
2022-07-27 08:14:00 【Bamboo monk-】
1. Exchange value
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=2064
Code :
#include<iostream>
using namespace std;
int a,b,c;// Defining variables
int main()
{
cin>>a>>b;
c=a;
a=b;
b=c;// In exchange for
cout<<a<<" "<<b;
return 0;
}
2. Sum of integers
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=2065

Code :
#include<iostream>
using namespace std;
int a,b,c;// Defining variables
int main()
{
cin>>a>>b>>c;// Input
cout<<a+b+c<<endl;// Output
return 0;
}3. Buy books
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=2066
Code :
#include<iostream>
using namespace std;
double n,m;// Defining variables
int main()
{
cin>>n>>m;// Input
m=m*0.8;
n=n-m;// Calculation
printf("%.2lf",n);//printf Two decimal places can be reserved
return 0;
}
4.A+B problem
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=1006
Code :
#include<iostream>
using namespace std;
int n,m;// Defining variables
int main()
{
cin>>n>>m;// Input
cout<<n+m<<endl;// Output
return 0;
}5. Calculation (a+b)*c Value

Code :
#include<iostream>
using namespace std;
int a,b,c,d;
int main()
{
cin>>a>>b>>c;// Input
d=a+b;
d=c*d;// Calculation
cout<<d<<endl;
return 0;
}6. Calculation (a+b)/c Value
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=1008
Code :
#include<iostream>
using namespace std;
int a,b,c;
int main()
{
cin>>a>>b>>c;// Input
cout<<(a+b)/c<<endl;// Calculation 、 Output
return 0;
}7. Division with remainder
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=1009
Code :
#include<iostream>
using namespace std;
int a,b;
int main()
{
cin>>a>>b;// Input
cout<<a/b<<" "<<a%b<<endl;// Calculation 、 Output
return 0;
}8. Calculate the floating-point value of a fraction
Original link
http://ybt.ssoier.cn:8088/problem_show.php?pid=1010
Code :
#include<iostream>
using namespace std;
int a,b;// Definition
int main()
{
cin>>a>>b;
printf("%.9lf",a*1.0/b); // Retain 9 Decimal place
return 0;
}Novice , Your advice are most welcome
边栏推荐
- What is a rebound shell? What's the use of bouncing shells?
- Opengauss stopped from the library and found that the main library could not write data
- Notes in "PHP Basics" PHP
- 企业架构驱动的数字化转型!
- Graph node deployment and testing
- Virtual machine cloning
- 情人节,我用字符画出了一个对象!
- 3D laser slam: Interpretation of logo-loam paper --- Abstract
- 北京五日游记
- The third letter to the little sister of the test | Oracle stored procedure knowledge sharing and test instructions
猜你喜欢

Plato farm is expected to further expand its ecosystem through elephant swap

ERP生产作业控制 华夏

"PHP Basics" tags in PHP

The seta 2020 international academic conference will be held soon. Welcome to attend!

Is redis really slowing down?

DEMO:ST05 找文本ID 信息
![[netding cup 2020 rosefinch group]nmap 1 two solutions](/img/fa/b1349cb42b5768b7510217239ba73a.png)
[netding cup 2020 rosefinch group]nmap 1 two solutions

A quick overview of transformer quantitative papers in emnlp 2020

Teach you to build a nail warning robot hand in hand

Enhancement: BTE process introduction
随机推荐
Solve the problem of slow batch insertion of MySQL JDBC data
Internet of things industrial UART serial port to WiFi to wired network port to Ethernet Gateway WiFi module selection
Introduction, installation and use of netdata performance monitoring tool
My senior
Download and usage of sequel Pro
C commissioned use cases
[pytorch] resnet18, resnet20, resnet34, resnet50 network structure and Implementation
Stored procedure test 1 -- first acquaintance of love
Vcenter7.0 installation of ibm3650m4 physical machine
CommonTitleBar hide left right
"PHP Basics" use of integer data
Dasctf2022.07 enabling game password WP
You may need an additional loader to handle the result of these loaders.
Use of string type "PHP Basics"
Digital transformation driven by enterprise architecture!
[target detection] yolov6 theoretical interpretation + practical test visdrone data set
Harbor can't log in with the correct password
Kalibr calibration realsensed435i -- multi camera calibration
Stored procedures and functions
C event usage case subscription event+=