博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
C语言第三次作业
阅读量:4458 次
发布时间:2019-06-08

本文共 2795 字,大约阅读时间需要 9 分钟。

#include
//1.三角形int main(){ printf("*\n"); printf("**\n"); printf("***\n"); printf("****\n"); printf("*****\n"); printf("******\n"); printf("*******\n"); printf("********\n"); printf("*********\n"); printf("**********\n"); }

 

 

#include
//3.倒三角形 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
//2.十行矩形 int main(){ printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n"); printf("**********\n");}
#include
int main()//五级制成绩(A~E),输出相应的百分制成绩(0~100)区间{ char score; scanf("%c",&score); 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; } return 0;}

 

 

#include
//华氏温度与摄氏温度的转换 int main(){ int F=100;//F为华氏温度,C为摄氏温度 int C; C=(5*(F-32)/9); printf("%d",C); return 0;}

 

#include
int main()//100米自由落体{ int g=10; int t=3; int height; height=0.5*g*t*t; printf("height=%d",height); return 0;}
#include
int main()//输出整数的个位数字、十位数字和百位数字的值{ int a; scanf("%d",&a); while(a!=0) { printf("%d\n",a%10); a=a/10; } return 0;}

 

#include
#include
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
#include
int main()//计算存款利息{ int year,money; double rate,interest; printf("请输入存期"); scanf("%d",&year); printf("请输入存款金额"); scanf("%d",&money); printf("请输入年利率"); scanf("%lf",&rate); interest=money*pow(1+rate,year)-money; printf("利息为%f",interest);return 0;}
#include
#include
int main()//计算电费 { double x,y; scanf("%lf",&x); if(x<=50) y=0.53*x; else y=0.53*50+(x-50)*0.58; printf("电费=%f",y); return 0; }

 

 

 

  

转载于:https://www.cnblogs.com/lmj863337969/p/5918108.html

你可能感兴趣的文章
连接不上sql server服务器的解决方案
查看>>
记录安装oracle的那些事(二)之双系统安装
查看>>
c3po数据库连接池中取出连接
查看>>
bootstrap-table 分页
查看>>
使用本机IP调试web项目
查看>>
【Java面试题】58 char型变量中能不能存贮一个中文汉字?为什么?
查看>>
C++ Primer 第六章 函数
查看>>
交互设计算法基础(3) - Quick Sort
查看>>
Ubuntu各种软件的安装
查看>>
智能社的邀请码
查看>>
算法与分析 统计数字问题和整数因子分解问题?
查看>>
变量提升
查看>>
谜题88:原生类型的处理
查看>>
ajax 415 错误 $.ajax 中的contentType
查看>>
【CodeForces】191C Fools and Roads
查看>>
enum hack
查看>>
2017.2.7 开涛shiro教程-第六章-Realm及相关对象(三)
查看>>
Visual Studio 2008切换到设计视图卡死解决办法-Troubleshooting "Visual Studio 2008 Design view hangs" issues...
查看>>
数据库设计范式
查看>>
sql2005-数据库备份方案 (转载)
查看>>