zoukankan      html  css  js  c++  java
  • 钟国晨 160809323(作业3)

    #include<stdio.h>
    int main()
    {
        printf("   * * * * * * * * * *
    ");
        printf("    * * * * * * * * *
    ");
        printf("     * * * * * * * *
    ");
        printf("      * * * * * * *
    ");
        printf("       * * * * * *
    ");
        printf("        * * * * *
    ");
        printf("         * * * *
    ");
        printf("          * * *
    ");
        printf("           * *
    ");
        printf("            *
    ");
        return 0; 
    }
    #include<stdio.h>
    int main()
    {
        printf("**********
    *********
    ********
    *******
    ******
    *****
    ****
    ***
    **
    *
    ");
    }
    #include<stdio.h>
    int main ()
    {
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        printf("**********
    ");
        return 0;
    }
    #include <stdio.h> //等级分数 
    int main()
    {
        char score;
        printf("请输出等级:"); 
        scanf ("%c",&score);//A B C D E 
        switch (score)
      {
        case'A':
        printf ("90~100");
        break;
        case'B':
        printf("80~89");
        break; 
        case'C':
        printf("70~79");
        break;
        case'D':
        printf("60~69");
        break;
        case'E':
        printf("0~59");
        break;
        default:
        printf("输入有误
    ");
        break;     
      }
      return 0;
    }
    #include<stdio.h> //华氏温度与摄氏温度的转换 
    int main()
    {
        int F=100;//F为华氏温度,C为摄氏温度 
        int C;
        C=(5*(F-32)/9); 
        printf("%d",C);
        return 0;
    }
    #include<stdio.h>//求下落距离 
    int main()
    {
        int t=3;
        int g=10;
        int H;//下落高度 
        H=0.5*g*t*t;
        printf("f(t)=%d",H);
        return 0;    
    } 
    #include<stdio.h>//152的个、十、百位数值
    int main()
    {
        int a,b,c,d;
        a=152;
        b=a/100;
        c=(a/10)%10;
        d=a%10;
        printf("百位是%d 十位是%d 个位是%d",b,c,d);
        return 0;
    }
    #include<stdio.h>//分段函数 
    #include<math.h>
    int main()
    {
        double x;
        double y;
        scanf("%lf",&x);
        if(x>=0)
        y=sqrt(x);
        else
        y=pow(x+1,2)+2*x+1/x;
        printf("f(x)=%f",y);
    } 
    #include<stdio.h>//计算利息 
    #include<math.h>
    int main()
    {
        int year;
        int money;
        double rate;
        double interest;
        printf("请输入存期"); 
        scanf("%d",&year) ;
        printf("请输入存款金额") ;
        scanf("%d",&money);
        printf("年利率");
        scanf("%lf",&rate);
        interest=money*pow(1+rate,year)-money;
        printf("到期时利息为%f",interest); 
    } 
    #include<stdio.h>//计算电费 
    int main()
    {
        double x;
        double y;
        scanf("%lf",&x);
        if(x<=50)
        y=0.53*x;
        else
        y=0.53*50+(x-50)*0.58;
        printf("f(x)=%f",y);
    }
  • 相关阅读:
    HAOI2008题解
    codeforces round375(div.2)题解
    codeforces round373(div.2) 题解
    TJOI2015题解
    CF976D. Degree Set
    dtoj#4243. 熊猫(i)
    dtoj#4242. 大爷(w)&&CF1061E
    CF786C Till I Collapse
    dtoj#4239. 删边(cip)
    dtoj#2504. ZCC loves cube(cube)
  • 原文地址:https://www.cnblogs.com/zgc1540161699/p/5915103.html
Copyright © 2011-2022 走看看