萌新80分(求大佬帮助)3点和4点

B2016 浮点数向零舍入

ikun_czy @ 2022-10-22 20:07:54


 #include<iostream>
#include<iomanip>
using namespace std;
int main(void)
{
    double y;
    int a;
    cin>>y;
    if(y>=0)
    {   
        cout<<int(y);
    }
    else
    {
        a=int(y);
        //a++;
        cout<<a;
    }

    return 0;
}

by ikun_czy @ 2022-10-22 20:08:45

求助SOS


by WOERDESUGX @ 2022-10-22 20:11:12

@czy888

long long


by Curry_Skyfxxker @ 2022-10-22 20:22:32

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

不开longlong见祖宗


by ikun_czy @ 2022-11-06 16:45:33

AC了


by Cybertruck @ 2023-04-29 10:19:37

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<string>
#include<cstdlib>
using namespace std;
double a;
int main(){
    cin>>a;
    cout<<(long long)a;
    return 0;
}

|