编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#25445 #1139. ddd和鸽子 Compile Error 0 0 ms 0 K C++ 11 / 489 B Eric 2020-05-01 22:02:19
显示原始代码
#include <iostream>
#include <cmath>
#include <cstring>
#include <cstdio>
using namespace std;
int main() {
    string s;
    cin >> s;
    int hour = s[0] - '0';
    hour = hour * 10 + s[1] - '0';
    int min = s[3] - '0';
    min = min * 10 + s[4] - '0';
    hour = hour % 12;
    float degree1 = hour * 30 + min / 2.0;
    float degree2 = min * 6.0;
    if (degree1 - degree2 < 0)
        print("%,1f", degree1 - degree2 + 180);
    else {
        printf("%.1f", degree1 - degree2);
    }
    return 0;
}

编译信息

/sandbox/1/a.cpp: In function 'int main()':
/sandbox/1/a.cpp:18:9: error: 'print' was not declared in this scope
         print("%,1f",degree1-degree2+180);
         ^~~~~
/sandbox/1/a.cpp:18:9: note: suggested alternative: 'printf'
         print("%,1f",degree1-degree2+180);
         ^~~~~
         printf