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

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

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

#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double a,b,x;
    cin>>a>>b;
    x=-b/a;
    cout<<x<<endl;
    return 0;
}
一元一次方程
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double R1,R2,A;
    cin>>R1>>R2;
    A=R1*R2/(R1+R2);
    cout<<A<<endl;
    return 0;
}
并联电阻
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double A,B,C,x;
    cin>>A>>B>>C;
    x=A+B-C;
    cout<<x<<endl;
    return 0;
}
特殊的方程
#include<iostream>
using namespace std;
int main()
{
    double R,m1,m2;    
    cin>>m1;
    cin>>m2;
    cin>>R;    
    cout<<(6.674e-11*m1*m2)/(R*R);
}
万有引力定律
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    double v1,v2,a,b;
    cin>>v1>>v2;
    a=v1*v1+v2*v2;
    b=a/2;
    cout<<sqrt(b)<<endl;
    return 0;
}
中点位移的速度
原文地址:https://www.cnblogs.com/mayitao/p/5839570.html