P2433 刷題記錄

這是洛谷順序結構題單中的一題,雖然說是小學數學,但是很多地方明明是奧數水平啊喂,這樣真的大丈夫嘛……
注意:本題對答案結構判定比較玄學,有的地方使用cout,有的地方需要使用printf,當然也有可能是我的水平太低:)
所以今天做這道題的時候WA了4次:(
P2433搞快點爬
所以如果要看答案/題解,請務必注意輸出方式:

#include <iostream>
#include <cmath>
#include <cstdio>

using namespace std;

int main() {
    int T;
    cin >> T;
    if (T == 1) {
        printf("I love Luogu!");
    } else if (T == 2) {
        printf("6 4");
    } else if (T == 3) {
        printf("3
12
2");
    } else if (T == 4) {
        printf("166.667");
    } else if (T == 5) {
        printf("15");
    } else if (T == 6) {
        cout<<sqrt(6*6+9*9)<<endl;
    } else if (T == 7) {
        printf("110
90
0
");
    } else if (T == 8) {
        const double pi = 3.141593;
        const double r = 5;
        cout<<pi*r*2<<endl<<pi*r*r<<endl<<4.0/3*pi*r*r*r<<endl;
    } else if (T == 9) {
        printf("%d", 22);
    } else if (T == 10) {
        cout << 9;
    } else if (T == 11) {
        cout << 1.0 * 100 / 3;
    } else if (T == 12) {
        cout << 13 << "
" << "R";
    } else if (T == 13) {
        const double pi = 3.1415923;
        int result = (int)pow(4456.872276266667, 1.0/3);
        printf("%d", result);
    } else if (T == 14) {
        cout << 50;
    }
    return 0;
}

PS:「因爲最近在用中州韻輸入法就直接寫繁體好了,請不用在意」

原文地址:https://www.cnblogs.com/kozumi/p/12727965.html