用户:
爵士OIer查看:0 回复:5 评论:0 创建时间:2019-04-19T22:27:03
原题如下:
时间:1s 空间:256M题目描述:
已知圆的半径,求它的周长和面积。
此题令pi=3.14159
输入格式:
一个实数a
输出格式:
输出两行,每行一个实数,第一行表示周长,第二行表示面积(结果均保留六位小数)
样例输入:
4.0
样例输出:
25.132720 50.265440
约定:
0<=a,b<=1000
我这样:
#include <bits/stdc++.h>
using
namespace
std;
int
main(){
int
v1 ;
cin >> v1 ;
cout << (v1*3.14159 +0.00005)/0.00001<< endl;
cout<<[(v1+0.0)/2(v1+0.0)/2*3.14159+0.00005]/0.00001;
return
0;
}
有什么问题?
爵士OIer#include <bits/stdc++.h>
using namespace std;
int main(){
int v1 ;
cin >> v1 ;
cout << (v1*3.14159 +0.00005)/0.00001<< endl;
cout<<[(v1+0.0)/2(v1+0.0)/2*3.14159+0.00005]/0.00001;
return 0;
}
点赞0
评论
爵士OIer#include <bits/stdc++.h>
using namespace std;
int main () {
double a;
cin >> a;
printf ("%.6lf\n",a*2*3.14159);
printf ("%.6lf",a*a*3.14159);
return 0;
}
点赞0
评论