首页 > 代码库 > 第三次作业160809322
第三次作业160809322
#include<stdio.h>int main()//华氏温度转摄氏温度 { int f; int c; printf("输入华氏温度: "); scanf("%d",&f); c=5*(f-32)/9; printf("%d",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);//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("输入有误\n"); break; } return 0;}
#include<stdio.h>#include<math.h>int main() { int g=10; int t=3; int height; height=0.5*g*t*t; printf("h=%d",height); return 0; }
#include<stdio.h>#include<math.h>int main(){ double x; double y; printf("请输入x的值:"); scanf("%lf",&x); if(x>=0) y=sqrt(x); else y=pow(x-1,2)+2*x+1/x; printf("y=f(x)=%.2f",y); }
#include<stdio.h> #include<math.h>int main() { int money,year; double rate,interest,a; printf("请输入存款金额:"); scanf("%d",&money); printf("请确认存期:"); scanf("%d",&year); printf("请确认年利率:"); scanf("%lf",&rate); a=pow(1+rate,year); interest=money*(a-1); printf("存款利息为:%f",interest);}
#include <stdio.h>int main(){ int x; double y; printf("请输入本月用电量:"); scanf("%d",&x); if(x<=50) y=0.53*x; else y=50*0.53+(x-50)*0.58; printf("本月电费为:%.2lf",y);}
第三次作业160809322
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。