#include<stdio.h> int main() { char grade; printf("请输入等级:"); scanf("%c",&grade); switch(grade) { 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 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 ",b); printf("十位数字的值为%d ",c); printf("百位数字的值为%d ",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(" * * * * * * * * * * "); printf(" * * * * * * * * * "); printf(" * * * * * * * * "); printf(" * * * * * * * "); printf(" * * * * * * "); printf(" * * * * * "); printf(" * * * * "); printf(" * * * "); printf(" * * "); printf(" * "); return 0; }
#include<stdio.h>//1.三角形 int main() { printf("* "); printf("** "); printf("*** "); printf("**** "); printf("***** "); printf("****** "); printf("******* "); printf("******** "); printf("********* "); printf("********** "); return 0; }
#include<stdio.h> int main() { printf("********** "); printf("********** "); printf("********** "); printf("********** "); printf("********** "); printf("********** "); printf("********** "); printf("********** "); printf("********** "); printf("********** "); }