首页 > 代码库 > c预言第三次作业

c预言第三次作业

#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");}
#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");}
#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");} 
#include <stdio.h>int main(){    char score;    printf("请输入数字:");     scanf ("%c",&score);    switch (score)  {    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 F=100;    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("%d",h);    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);    return 0;}
#include<stdio.h>#include<math.h>int main(){   int money,year;    double rate,interest;    printf("输入存款金额: ");    scanf("%d",&money);    printf("输入存期: ");    scanf("%d",&year);    printf("输入年利率: ");    scanf("%lf",&rate);    interest=money*pow(1+rate,year)-money;    printf("interest=%f\n",interest);    return 0;}
#include <stdio.h>int main(){     int c ;   double f;   scanf("%d",&c);   if(c<=50)     {f=0.53*c;}   else     {f=50*0.53+(c-50)*0.05;}   printf("%lf",f);   return 0;}

 

 

c预言第三次作业