初学者入门——NOI题库1.3

建议上网搜搜NOI题库做做,有用的。

1.3-1

#include
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	cout<

1.3-2

#include
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(a+b)*c<

1.3-3

#include
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<(a+b)/c<

1.3-4

#include
using namespace std;
int main(){
	int a,b,c;
	cin>>a>>b;
	c=a/b;
	cout<

1.3-5

#include
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	printf("%.9lf",(double)a/b);//cout<

1.3-6

#include
using namespace std;
int main(){
	int a,b;
	cin>>a>>b;
	printf("%.3lf%%",(double)b/a*100);//cout<

1.3-7

#include
using namespace std;
int main(){
	double x,a,b,c,d;
	cin>>x>>a>>b>>c>>d;
	printf("%.7lf",a*x*x*x+b*x*x+c*x+d);//cout<

1.3-8

#include
using namespace std;
int main(){
	double f;
	cin>>f;
	printf("%.5lf",5*(f-32)/9);//cout<

1.3-9

#include
using namespace std;
int main(){
	double r,l,c,s,pi=3.14159;
	scanf("%lf",&r);//cin>>r;
	l=2*r;
	c=2*pi*r;        //cout<

1.3-10

#include
using namespace std;
int main(){
	float r1,r2,R;
	scanf("%f%f",&r1,&r2);//cin>>r1>>r2;
	R=1/(1/r1+1/r2);
	printf("%.2f",R);//cout<

1.3-11

#include
using namespace std;
int main(){
	double a,b,c;
	scanf("%lf%lf",&a,&b);//cin>>a>>b;
	c=a/b;
	printf("%g",a-b*(int)c);
	return 0;
}

1.3-12

#include
using namespace std;
int main(){
	double r,v,pi=3.14;
	scanf("%lf",&r);//cin>>r;
	v=4.0/3.0*pi*r*r*r;
	printf("%.2lf",v);//cout<

1.3-13

#include
using namespace std;
int main() {
	int a,b,c,d;
	scanf("%d",&a);//cin>>a;
	b=a/100;
	c=(a%100)/10;
	d=a%10;
	printf("%d%d%d",d,c,b);//cout<

1.3-14

#include
using namespace std;
int main(){
	int h,r,t;
	double pi=3.14159;
	scanf("%d%d",&h,&r);//cin>>h>>r;
	t=20000/(pi*r*r*h);
	printf("%d",t+1);//cout<

1.3-15

#include
using namespace std;
int main(){
	int n,x,y;
	double s;
	scanf("%d%d%d",&n,&x,&y);//cin>>n>>x>>y;
	s=(double)y/x;
	if((int)s

1.3-16

#include
using namespace std;
int main(){
	double Xa,Ya,Xb,Yb,l;
	scanf("%lf%lf\n%lf%lf",&Xa,&Ya,&Xb,&Yb);
	l=sqrt((Xa-Xb)*(Xa-Xb)+(Ya-Yb)*(Ya-Yb));
	printf("%.3lf",l);
	return 0;
}

1.3-17

#include
using namespace std;
int main(){
	float x1,y1,x2,y2,x3,y3,s,p,a,b,c;
	scanf("%f%f%f%f%f%f",&x1,&y1,&x2,&y2,&x3,&y3);
    a=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
	b=sqrt((x1-x3)*(x1-x3)+(y1-y3)*(y1-y3));
	c=sqrt((x2-x3)*(x2-x3)+(y2-y3)*(y2-y3));
	p=0.5*(a+b+c);
	s=sqrt(p*(p-a)*(p-b)*(p-c));
	printf("%.2f",s); 
	return 0;
}

1.3-18

#include
using namespace std;
int main(){
	int a1,a2,n;
	scanf("%d%d%d",&a1,&a2,&n);
	printf("%d",a1+(a2-a1)*(n-1));
	return 0;
}

1.3-19

#include
using namespace std;
int main(){
	unsigned int a,b;
	long long s;
	scanf("%d%d",&a,&b);
	s=a*b;
	printf("%lld",s);
	return 0;
}

1.3-20

#include
using namespace std;
int main(){
	unsigned n,s;
	scanf("%d",&n);
	s=pow(2,n);
	printf("%d",s);
	return 0;
}

你可能感兴趣的:(蓝桥杯,c++,算法)