首页 > 代码库 > 施润行160809301(作业3)

施润行160809301(作业3)

#include<stdio.h>int main(){    char grade;    printf("请输入等级:");    scanf("%c",&grade);    switch(grade)        {            caseA:               printf("90-100");               break;            caseB:               printf("80-89");               break;            caseC:               printf("70-79");               break;            caseD:               printf("60-69");               break;            caseE:               printf("0-59");                break;            default:                printf("输入错误");                 break;        }    return 0;    }
#include<stdio.h>int main(){    int a=100;    int b;    printf("%d",b=5*(a-32)/9);    return 0;}
#include<stdio.h>int main(){    int a=3;    int b;    printf("%d",b=(10*a*a)/2);    return 0;    }
#include<stdio.h>int main(){    int a=152;    int b;    int c;    int d;    b=a%10;    c=(a/10)%10;    d=a/100;    printf("个位数字的值为%d\n",b);    printf("十位数字的值为%d\n",c);    printf("百位数字的值为%d\n",d);    return 0;} 
#include<stdio.h>#include<math.h>int main(){ double x, y; printf("请输入一个值:"); scanf("%lf", &x);    if (x>=0)     y = pow(x,0.5);   else     y = pow(x+1,2)+2*x+1/x; printf("对应y的值是:%.2f",y); return 0;}
#include<stdio.h>#include<math.h>int main(){    int y,m;    double r,i;    printf("请输入存期");    scanf("%d",&y);    printf("请输入存款金额");    scanf("%d",&m);    printf("请输入年利率");    scanf("%lf",&r);     i=m*pow(1+r,y)-m;    printf("利息为%f",i);    return 0;} 
#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);    return 0;}
#include<stdio.h>int main(){    printf("   * * * * * * * * * *\n");    printf("    * * * * * * * * *\n");    printf("     * * * * * * * *\n");    printf("      * * * * * * *\n");    printf("       * * * * * *\n");    printf("        * * * * *\n");    printf("         * * * *\n");    printf("          * * *\n");    printf("           * *\n");    printf("            *\n");    return 0; }
#include<stdio.h>//1.三角形int main(){        printf("*\n");    printf("**\n");    printf("***\n");    printf("****\n");    printf("*****\n");    printf("******\n");    printf("*******\n");    printf("********\n");    printf("*********\n");    printf("**********\n");    return 0;    }
#include<stdio.h>int main(){    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");    printf("**********\n");} 

 

施润行160809301(作业3)