算法竞赛入门经典(第二版)(第一章)

#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
    /*int a,b,c;
    double y;
    scanf("%d%d%d",&a,&b,&c);
    printf("%.3f",(a+b+c)*1.0/3.0);*/
    /*int a;
    double x;
    scanf("%d",&a);
    x=5.0*(a-32)*1.0/9.0;
    printf("%.3f\n",x);*/
    /*int n;
    scanf("%d",&n);
    printf("%d",(1+n)*n/2);*/
    /*int n;
    const double pi=acos(-1.0);
    scanf("%d",&n);
    double y=pi/180*n;
    double z=sin(y);
    double x=cos(y);
    printf("%lf%lf",z,x);*/
    /*int n;
    scanf("%d",&n);
    if(n<=3)
        printf("%d\n",n*95);
    else
    {
        int p=n*95*0.85;
        printf("%d\n",p);
    }*/
    /*int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if(a>b) swap(a,b);
    if(a>c) swap(a,c);
    if(b>c) swap(b,c);
    if(a+b<c)
        printf("not a triangle");
    else if(a*a+b*b==c*c)
        printf("yes");
    else
        printf("no");*/
    int n;
    scanf("%d",&n);
    if(n%400==0||n%4==0&&n%100!=0)
        printf("yes\n");
    else
        printf("no\n");
    return 0;
}
    //1.5
    /*printf("%d\n",11111*11111);int: -2147483648~2147483647  (10位数,2e9   2^31 - 1)
    long long int: -9223372036854775808~9223372036854775807  (19位数, 9e18 ) 2^63 - 1
    printf("%lf\n",11111.0*11111.0);double:-3.4e38~3.4e38*/
    /*printf("%lf\n",sqrt(-1.0));flase
    printf("%lf\n",acos(-1.0));*/
    /*printf("%d",0.0/0.0);d能过,lf不能过*/
    /*printf("%d",1/0);flase*/
    /*int a,b;
    scanf("%d%d",&a,&b);
    printf("%d\n\n%d\n",a,b);
    printf("\\n%s","%d");
    return 0;
}*/
    //1.4
    /*int a,b,m,n;
    scanf("%d%d",&n,&m);
    a=(4*n-m)/2;
    b=n-a;
    if(m%2==1||a<0||b<0)
        printf("no answeer\n");
    else
        printf("%d %d",a,b);
    return 0;
}*/
    //1.2-1.3
    /*int a,b;
    scanf("%d%d",&a,&b);
    printf("%d\n",a+b);*/

    /*const double pi=acos(-1.0);
    double r,h,s1,s2,s;
    scanf("%lf%lf",&r,&h);
    s1=pi*r*r;
    s2=2.0*pi*r*h;
    s=s1*2.0+s2;
    printf("area = %.3f\n",s);*/
    /*int n,m;
    scanf("%d",&n);
    m=(n%10)*100+(n%100/10)*10+(n/100);
    printf("%03d\n",m);*/
    /*int a,b,c;
    scanf("%d%d",&a,&b);
    c=a;
    a=b;
    b=c;
    printf("%d %d\n",a,b);
    return 0;
}*/
    //1.1
    /*printf("%d\n",1+2);
    printf("%.1f\n",8.0/5.0);
    printf("%.2f\n",8.0/5.0);
    printf("%f\n",8.0/5.0);
    printf("%.1f\n",8/5);
    printf("%.8f\n",1+2*sqrt(3)/(5-0.1));
    return 0;
}*/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值