zoukankan      html  css  js  c++  java
  • 实验二

    #include<stdio.h>
    int main()
    {
        char a,b,c,d,e;
        a=getchar();
        b=getchar();
        c=getchar();
        d=getchar();
        e=getchar();
        putchar(a);
        putchar(b);
        putchar(c);
        putchar(d);
        putchar(e);
        return 0;
    }

     

    #include <stdio.h>
    int main(){
        int year;
     printf("input the year:");
        scanf("%d",&year);
        if(year % 100 !=0 && year % 4 == 0 || year % 400 == 0){
            printf("year:%d,month:2,days:29 ",year);
        }else{
            printf("year:%d,month:2,days:28 ",year);
        }
        return 0;
    }

    #include <stdio.h>
    int main(){
        int a,b,c;
        scanf("%d%d%d",&a,&b,&c);
        if((a+b>c)&&(b+c>a)&&(a+c>b)){
            if(a==b&&b==c){
                printf("等边三角形");
            }else if((a==b)||(a==c)||(b==c)){
                printf("等腰三角形");
            }else if(a*a+b*b==c*c||a*a+c*c==b*b||b*b+c*c==a*a){
                printf("直角三角形");
            }else{
            printf("一般三角形");
            }
        }
        return 0;
    }

    #include <stdio.h>
    int main(){
        double a,rate,tax,profit;
        scanf("%lf",&a);
        int x;
        x = a / 500;
        switch(x){
        case 0:rate=0.00;break;
        case 1:rate=0.05;break;
        case 2:rate=0.08;break;
        case 3:rate=0.08;break;
        case 4:rate=0.10;break;
        case 5:rate=0.10;break;
        case 6:rate=0.10;break;
        case 7:rate=0.10;break;
        case 8:rate=0.10;break;
        case 9:rate=0.10;break;
        default:rate=0.15;
        }
        tax=a*rate;
        profit=a*(1-rate);
        printf("a=%lf
    rate=%lf
    tax=%lf
    profit=%lf
    ",a,rate,tax,profit);
        return 0;
    }

  • 相关阅读:
    hihocoder 1049 后序遍历
    hihocoder 1310 岛屿
    Leetcode 63. Unique Paths II
    Leetcode 62. Unique Paths
    Leetcode 70. Climbing Stairs
    poj 3544 Journey with Pigs
    Leetcode 338. Counting Bits
    Leetcode 136. Single Number
    Leetcode 342. Power of Four
    Leetcode 299. Bulls and Cows
  • 原文地址:https://www.cnblogs.com/p201821440045/p/10671150.html
Copyright © 2011-2022 走看看