64位有符号整数问题
想问一下为什么这道题题目里说输入不超过64位有符号整数的表示范围,但是用unsigned long long int 处理不行,要手动模拟?http://acm.xidian.
2018-12-14 10:55
程序代码:#include <stdio.h>
int main( void )
{
for( unsigned long long n; scanf("%llu",&n)==1; )
{
if( n%10 >= 5 )
n += 10;
printf( "%llu.%02llu\n", n/1000, n%1000/10 );
}
}
2018-12-14 12:32

程序代码:
#include<iostream>
#include<functional>
#include<iomanip>
using namespace std;
unsigned long long int a;
int main(void){
double b;
while(cin>>a){
b=(double)a;
b/=1000;
cout<<fixed<<setprecision(2)<<b<<endl;
}
return 0;
}
2018-12-14 15:34
2018-12-14 16:17
[此贴子已经被作者于2018-12-15 00:10编辑过]
2018-12-15 00:08