竞赛
考级
给个赞吧
WA君
#include <bits/stdc++.h> using namespace std; int main(){ double a,b; cin >> a >> b; printf("%.2f",sqrt(pow(a,2)+pow(b,2))); return 0; }
龘
战神老六
哒烧叶
#include<cstdio> #include<iostream> #include<cmath> using namespace std; int main(){ int a,b; cin>>a>>b; printf("%.2f",sqrt(aa+bb)); return 0; } //万能头文件也可以;万能头文件:#include<bits/stdc++.h>
鲁昱麟
题解 勾股定理是什么? 勾股定理是直角三角形三条边的关系 勾股定理的公式 勾股定理的公式一般表示为a2+b2=c2a^2 + b^2 = c^2a2+b2=c2 可以推断出:c=sqrt(a2+b2)c = sqrt(a^2 + b^2)c=sqrt(a2+b2) ##AC代码
Yuzekai
复仇者_摆烂崽
耐高总冠军 张文杰
简单计算即可,考察的主要是 cmath 库的使用以及保留小数。
T
王子豪
#include <bits/stdc++.h> using namespace std; int main(){ double a,b,c; cin>>a>>b; c=sqrt((aa)+(bb)); cout<<fixed<<setprecision(2)<<c<<endl; return 0; }
霄
#include<cstring> #include<cmath> #include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; float c; c=sqrt(pow(a,2)+pow(b,2)); cout<<fixed<<setprecision(2)<<c; return 0; }
ཌༀ130****2142ༀད
#include<iostream> #include<cmath> using namespace std; int main(){ int a,b; cin>>a>>b; double c; c=sqrt(aa+bb); printf("%.2lf",c); return 0; }
王以恒
#include<bits/stdc++.h>; using namespace std; int main(){short a,b,c;cin>>a>>b;c=aa+bb;printf("%.2f",sqrt(c));return 0;}
射手骑着龙——互
136****4819
黑客_天之神_ZDZL_zsy
注意要导入math模块 import math a,b=input().split() a=int(a) b=int(b) c=a2+b2 c=math.sqrt(c) c='%.2f' % c print(c)
151****9879
有事找大号
#include <bits/stdc++.h> using namespace std; int main(){ int a,b; cin >> a >> b; printf("%.2f",sqrt(aa+bb)); return 0; }
T0
#include <bits/stdc++.h> using namespace std; int main() { double a,b; cin>>a>>b; double c= pow(a,2)+pow(b,2); printf("%.2lf",sqrt(c)); return 0; }
~Lyney~
共43条