long long 和%lld %ld %d(不理解,请留下评论,必回)

星际穿越

http://www.nowcoder.com/questionTerminal/53e4c208b8cf497086ecd65ef45349bb

unsigned long long 范围0-18446744073709551615
在本编译环境中 %d=%ld 用%lld

(%d=int,%ld=long,%lld=long long;)

#include<stdio.h>
#include<math.h>
int main()
{
    long long h,x;
    scanf("%lld",&h);//h=x+x*x.4h=4x+4x*x,4h+1=2*2*x+2*2*x*x+1*1,sqrt(4h+1)=2x+1,(sqrt(4h+1)-1)/2=x
    x=(sqrt(4*h+1)-1)/2;
    printf("%lld",x);
    return 0;
}







全部评论

相关推荐

野猪不是猪🐗:我assume that你must技术aspect是solid的,temperament也挺good的,however面试不太serious,generally会feel style上不够sharp
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
06-24 14:18
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务