zoukankan      html  css  js  c++  java
  • shiyan2

    #include <stdio.h>

    int main()

    {  

    char a,b,c,d,e;

     printf("请输入五个字符: ");   

      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>

    void main()

    {  

    int year,a;  

    printf("请输入年份:");  

    scanf("%d",&year);

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

    else a=0;   

    if (a==1)  

    printf(" %d年的二月份有29天 ",year);  

    else printf("%d年的二月有28天 ",year);

    }

    #include <stdio.h>

    int main(void)

    {

     int a,b,c,temp;

      printf("请输入三角形三边的长:");

      scanf("%d%d%d",&a,&b,&c);    

    if(a<b)

      {  

      temp=a;

      a=b;  

    b=temp;  

    }    

    if(a<c)  

    {    

    temp=a;  

    a=c;  

    c=temp;  

    }

      if(b<c)

      {   

    temp=b;     

      b=c;   

    c=temp;

      }

      if(a<=0||b<=0||c<=0||b+c<=a)

      {  

    printf("该三角形不成立 ");

      return 0;  

    }  

    if (a==b&&b==c)

      {  

    printf("该三角形是等边三角形 ");  

    return 0;  

    }  

    if((a==b||b==c))  

    {  

    printf("该三角形是等腰三角形 ");

      return 0;

      }

      if(a*a==b*b+c*c)

      {

      printf("该三角形是直角三角形 ");

      return 0;  

    }  

    printf("该三角形是一般三角形 ");

      return 0;

    }

    #include <stdio.h>

    #include <math.h>

    int main()

    {    

    double a,rate,tax,profit;

     printf("input a");

     scanf("%lf",&a);

     if (a<500)

     {   

    rate=0.00;  

     tax=a*rate;   

    profit=a-tax;  

     printf("a=%lf ",a);

      printf("rate=%lf ",rate);  

     printf("tax=%lf ",tax);

      printf("profit=%lf ",profit);

     }

     else if(500<=a<1000)  

     {

      rate=0.05;

      tax=a*rate;

      profit=a-tax;   

    printf("a=%lf ",a);

      printf("rate=%lf ",rate);  

     printf("tax=%lf ",tax);  

     printf("profit=%lf ",profit);

     }

     else if(1000<=a<2000)

     {  

     rate=0.08;

      tax=a*rate;   

    profit=a-tax;   

    printf("a=%lf ",a);  

     printf("rate=%lf ",rate);

      printf("tax=%lf ",tax);   

    printf("profit=%lf ",profit);  

    }

     else if(2000<=a<5000)  

    {  

     rate=0.10;

      tax=a*rate;

      profit=a-tax;

      printf("a=%lf ",a);

      printf("rate=%lf ",rate);

      printf("tax=%lf ",tax);  

     printf("profit=%lf ",profit);

     }   

      else if(5000<=a)

     {

      rate=0.15;   

    tax=a*rate;  

     profit=a-tax;   

    printf("a=%lf ",a);

      printf("rate=%lf ",rate);  

     printf("tax=%lf ",tax);

      printf("profit=%lf ",profit);

     }

      return 0;

    }

  • 相关阅读:
    关于 iOS 证书,你必须了解的知识
    Spark踩坑记:共享变量
    Python 操作 MySQL 的正确姿势
    【黑客浅析】像黑客一样思考
    利用 Flask+Redis 维护 IP 代理池
    程序员的江湖:从黑木崖到回龙观
    [NM 状态机1] Application状态机详解
    Hadoop 2.0 编译问题小结
    Yarn上的几个问题整理
    Yarn中如何生成状态机图
  • 原文地址:https://www.cnblogs.com/p201821430038/p/10769193.html
Copyright © 2011-2022 走看看