21.求筝形面积
#include<bits/stdc++.h>
using namespace std;
long long a,b,c,d;
int main(){
cin>>a>>b;
c=a*b;
cout<<c;
return 0;
}
22.求正立方体表面积
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a,x;
cin>>a;
x=6*a*a;
cout<<x;
}
23.输出保留3位小数的浮点数
#include<bits/stdc++.h>
using namespace std;
int main()
{
double x;
cin>>x;
printf("%0.3lf",x);
return 0;
}
24.工资
#include <bits/stdc++.h>
using namespace std;
#define LL long long
int main() {
double a,b,c;
cin>>a>>b>>c;
cout<<"NUMBER = "<<a<<endl;
printf("SALARY = U$ %.2lf",b*c);
return 0;
}
25.四舍五入
#include <bits/stdc++.h>
using namespace std;
#define LL long long
int main() {
double a;
int b;
cin>>a>>b;
printf("%.*lf",b,a);
return 0;
}
26.求梯形面积
#include<bits/stdc++.h>
using namespace std;
int main()
{
double a,b,c,x;
cin>>a>>b>>c;
x=(a+b)*c/2;
printf("%0.2lf",x);
}
27.梯形面积
#include<bits/stdc++.h>
using namespace std;
int main(){
cout<<"426.67";
}
28.求圆柱体表面积
#include<bits/stdc++.h>
using namespace std;
double r,h,c;
int main(){
cin>>r>>h;
c=2*r*r*3.14+h*2*3.14*r;
cout<<c;
return 0;
}
29.计算总成绩与平均成绩
#include<iostream>
using namespace std;
int main()
{
double a,b,c,d,x,y;
cin>>a>>b>>c>>d;
x=a+b+c+d;
y=(a+b+c+d)/4;
printf("%0.2lf\n",x);
printf("%0.2lf",y);
}
30.新平均成绩
#include<iostream>
using namespace std;
int main()
{
double a,b,c,x;
cin>>a>>b>>c;
x=(a*c-b)/(c-1);
printf("%0.3lf",x);
return 0;
}