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

    #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);

             putchar(' ');

    return 0;

    }

     

    #include <stdio.h>

    int main()

    {

             int year,days,month;

             printf("input the year:");

             scanf("%d",&year);

             if((year%4==0&&year%100!=0)||year%400==0)

             {        month=2;

               days=29;

               printf("year:%d month:%d days:%d",year,month,days);}

        else

             {month=2;

             days=28;

             printf("year:%d month:%d days:%d ",year,month,days);}

    return 0;

    }

    #include<stdio.h>
    #include<stdlib.h>
    int main()
    {
     int a, b, c;
     printf("input three numbers: ");
     scanf("%d", &a);
     scanf("%d", &b);
     scanf("%d", &c);
     if (a + b > c && a + c > b && b + c > a)
     {
      if (a == b || a == c || b == c)
      {
       if (a == b && 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("等腰三角形 ");
       }
      }
      else if(a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a)
      {
       printf("直角三角形 ");
      }
      else
      {
       printf("一般三角形 ");
      }
     }
     else
     {
      printf("构不成三角形 ");
     }
     system("pause");
     return 0;
    }

    #include<stdio.h>

    int main()

    {

             double a,rate,tax,profit;

             scanf("%lf",&a);

             if(a<500.00){rate=0.00;}

             else if(500<=a&&a<1000){rate=0.05;}

             else if(1000<=a&&a<2000){rate=0.08;}

             else if(2000<=a&&a<5000){rate=0.10;}

             else if(a>=5000){rate=0.15;}

             tax=a*rate;

             profit=a-tax;

             printf("a=%lf rate=%lf tax=%lf profit=%lf",a,rate,tax,profit);

    return 0;

    }

  • 相关阅读:
    点击添加按钮添加一条记录,点击删除按钮删除本条记录
    两个input在一行让它们能对齐
    H5页面在微信中禁止下拉露出网页
    纯css实现隐藏滚动条仍可以滚动
    jQuery弹出层layer插件的使用
    flex组合流动布局实例---利用css的order属性改变盒子排列顺序
    媒体查询样式失效的解决办法
    menu-普通menu弹出框样式
    5lession-path路径相关操作
    do_pj--下拉代码脚本的使用
  • 原文地址:https://www.cnblogs.com/P201821440004/p/10750416.html
Copyright © 2011-2022 走看看