zoukankan      html  css  js  c++  java
  • 白皮 Chapter 1

    6.29 今天主要做了一些1.5中的小结和练习,果然换语言思路也要跟着变么…各种不爽啊不爽…

    scanf各种忘记&,还有各种忘记return 0…

    average
    temperature
    sum
    sincos
    distance

    7.1 继续做习题…

    #include<stdio.h>
    #include<math.h>
    
    int main()
    {
        int n;
        scanf("%d",&n);
        if (n % 2==1) printf("no"); else printf("yes");
        return 0;
    }
    odd
    #include<stdio.h>
    #include<math.h>
    
    int main()
    {
        int s,n;
        double m;
        scanf("%d",&n);
        s=95*n;
        if (s>=300) m=((float) s)*0.85; else m=(float) s;
        printf("%.2lf",m);
        return 0;
    }
    discount
    #include<stdio.h>
    #include<math.h>
    
    int main()
    {
        double a;
        scanf("%lf",&a);
        if (a<0) a=-a;
        printf("%.2lf",a);
        return 0;
    }
    abs
    #include<stdio.h>
    #include<math.h>
    
    int main()
    {
        int a,b,c,t;
        scanf("%d%d%d",&a,&b,&c);
        //sort
        if (a>b) {t=a;a=b;b=t;}
        if (a>c) {t=a;a=c;c=b;}
        if (b>c) {t=b;b=c;c=t;}
        //determine
        if (c<a+b) {
            if (c*c==a*a+b*b) printf("yes"); else printf("no");
        }
        else printf("not a triangle");
        return 0;
    }
    triangle
    #include<stdio.h>
    #include<math.h>
    
    int main()
    {
        int y;
        scanf("%d",&y);
        if (y%4==0){
            if (y%400==0) printf("yes");
                else {if  (y%100==0) printf("no"); else printf("yes");}
        }
        else printf("no");
        return 0;
    }
    year
  • 相关阅读:
    toj 2819 Travel
    toj 2807 Number Sort
    zoj 2818 Prairie dogs IV
    zoj 1276 Optimal Array Multiplication Sequence
    toj 2802 Tom's Game
    toj 2798 Farey Sequence
    toj 2815 Searching Problem
    toj 2806 Replace Words
    toj 2794 Bus
    css截取字符
  • 原文地址:https://www.cnblogs.com/Sky-Grey/p/4609259.html
Copyright © 2011-2022 走看看