80求助

B2016 浮点数向零舍入

liuhaowei123 @ 2025-01-11 11:25:17

#include<bits/stdc++.h>
using namespace std;
int main(){
    double a;
    cin>>a;
    cout<<int(a);
}

by wangshengchen @ 2025-01-11 11:34:29

@liuhaowei123 哈哈,又是我。

#include<bits/stdc++.h>
using namespace std;
int main(){
    double a;
    cin>>a;
    cout<<(long long)a;/*********************/
}

|