编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#24326 #1007. G. 兼济天下 Compile Error 0 0 ms 0 K C++ / 261 B john1122334 2020-04-23 20:02:46
显示原始代码
#include <iostream>
using namespace std;
int main() {
    int a;
    cin >> a;
    for (int i = 0; i < a; i++) {
        int m, n;
        cin >> n >> m;
        n--;
        int j = m % n;
        double c = (double)j / n - j + n - 1;
        if (c < 1e-9) {
            cout << "CSFNB!" << endl;
        } else {
            printf("%f", c);
        }
    }
    return 0;
}

编译信息

/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:15:8: error: 'printf' was not declared in this scope
   else{printf("%f",c);}
        ^~~~~~
/sandbox/1/a.cpp:15:8: note: 'printf' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
/sandbox/1/a.cpp:2:1:
+#include <cstdio>
 using namespace std;
/sandbox/1/a.cpp:15:8:
   else{printf("%f",c);}
        ^~~~~~