NOI / 1.3编程基础之算术表达式与顺序执行(上)! 来啦

NOI

 / 

1.3编程基础之算术表达式与顺序执行

多多指教!!哥哥们。。

 

1.

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	cout<<a+b;  
   return 0;
} 

2.

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(a+b)*c;  
   return 0;
} 

3。

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(a+b)/c;  
   return 0;
} 

4.

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	cout<<a/b<<" "<<a%b;
   return 0;
}

5.

#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	double a, b;
	scanf("%lf%lf",&a,&b);
	double c = a/b;
	printf("%.9lf",c);
	return 0;
}

6.

#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	//int a, b;
	double a, b;
	scanf("%lf%lf",&a,&b);
	double c = b/a*100;
	printf("%.3lf%%",c);
	return 0;
}

7.

#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	double x, a, b, c, d;
	scanf("%lf%lf%lf%lf%lf",&x,&a,&b,&c,&d);
	double ans = x*x*x*a+b*x*x+c*x+d;
	printf("%.7lf",ans);
	return 0;
}

8.

#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	double x;
	scanf("%lf",&x);
	double ans = 5*(x-32)/9;
	printf("%.5lf",ans);
	return 0;
}

9.

#include <bits/stdc++.h>
using namespace std;
int main(){
	double r,d,c,s;
	cin>>r;
	d=r*2;
	c=2*3.14159*r;
	s=r*r*3.14159;
	printf("%.4lf %.4lf %.4lf",d,c,s);    
   return 0;
}

10.

#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	float a, b;
	scanf("%f%f",&a,&b);
	float r = 1/(1/a + 1/b);
	printf("%.2f",r);
	return 0;
}

制作不易,一键三连+转发呀。。

小姐姐谢谢你们了!!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值