Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

用 G++ WA 的, 可以试试 C++

Posted by edwinhu233 at 2018-01-31 23:45:19 on Problem 1799
我的代码用 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator