首师大附中科创教育平台 我的刷题记录(3)

首师大附中科创教育平台我的刷题记录(给大家刷11--15题吧)

仅供同学们参考,禁止抄袭!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int x,y;
    cin>>x;
    y=abs(x+2);
    cout<<x*x-y+5<<endl;
    return 0;
}
绝对值函数
#include<iostream>
using namespace std;
int main()
{
    int t,s;
    cin>>t;
    s=t*10+2*t*t;
    cout<<s<<endl;
    return 0;
}
求滑动距离
#include<iostream>
using namespace std;
int main()
{
    double r,h,a;
    cin>>r>>h;
    a=r*r*3.14*h;
    cout<<a<<endl;
    return 0;
}
求圆柱体体积
#include<iostream>
using namespace std;
int main()
{
    double L,R,V,Q,C;
    cin>>L>>R>>V;
    Q=L*R;
    C=L+R+V;
    cout<<"Q:"<<Q<<endl;
    cout<<"C:"<<C<<endl;
    return 0;
}
简单的计算
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double a,b,c,d;
    cin>>a>>b;
    c=a*a+b*b;
    d=sqrt(c);
    cout<<a*a+b*b+d*d<<endl;
    return 0;
}
直角三角求解
原文地址:https://www.cnblogs.com/mayitao/p/5837571.html