| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
用 G++ WA 的, 可以试试 C++我的代码用 C++ 可以过, 用 G++ 就 WA 了. 很迷
#include <cstdio>
#include <cmath>
double foo(double R, int n) {
double t = std::sin(3.1415926 / n);
return R * t / (t + 1);
}
int main() {
int N;
std::scanf("%d", &N);
for (int i = 1; i <= N; ++i) {
int n;
double R;
std::scanf("%lf %d", &R, &n);
std::printf("Scenario #%d:\n", i);
std::printf("%.3lf\n\n", foo(R, n));
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator