求助!c++才得80分!OTATO~

B2016 浮点数向零舍入

sunbinbin120808 @ 2023-09-17 15:52:54

#include <bits/stdc++.h>
using namespace std;
int main() {
    double n;
    cin >> n;
    int m = int(n);
    cout << m;
    return 0;
}

by _YTY_ @ 2023-09-17 15:55:08

直接不用double就好啦@sunbinbin

#include<bits/stdc++.h>
using namespace std;
long long x;
int main(){
    cin>>x; cout<<x;
    return 0;
}

by _YTY_ @ 2023-09-17 15:55:32

求关注


by _YTY_ @ 2023-09-17 15:56:34

@sunbinbin 还要开long long


by sunbinbin120808 @ 2023-09-17 16:00:36

@YTY 已关注


|