华师一附中OI组
标题:
圆和正方形
[打印本页]
作者:
新504章紫蕗
时间:
2021-8-14 19:39
标题:
圆和正方形
#include<iostream>
using namespace std;
float c,s1,s2,r;
int main()
{
cin>>c;
s1=(c/4)*(c/4);
r=c/3.14/2;
s2=r*r*3.14;
cout<<s2/s1<<endl;
if(s1>s2) cout<<s1<<" "<<s2<<"正方形大";
else cout<<s1<<" "<<s2<<"圆大";
return 0;
}
欢迎光临 华师一附中OI组 (http://hsyit.cn/)
Powered by Discuz! X3.2