作业2 160809210
2016-09-27 21:43
417 查看
#include <stdio.h> int main(){ int a,b,c,t; printf("10,20,111;"); scanf("%d %d %d",&a,&b,&c); if(a<b){ t=a; a=b; b=t; } if(b>c){ printf("%d\t%d\t%d\n",a,b,c); } else if(c>a){ printf("%d\t%d\t%d\n",c,a,b); } else{ printf("%d\t%d\t%d\n",a,c,b); } return 0; }
2
#include <stdio.h> #include <math.h> int main(){ float x,y; printf("请输入"); scanf("%f",&x); if(x>4){ y=sqrt(x-4); printf("%f",y); } else if(x<-5){ y=fabs(x); printf("%f",y); } else{ y=x+3; printf("%f",y); } }
3
#include <stdio.h> int main() { char c; printf("请输入:\n"); scanf("%c",&c); printf("大写是:%c\n",c-32); }
4
#include <stdio.h> int main() { int x,y; printf("请输入\n"); scanf("%d",&x); if(x<1){ y=x; printf("%d",y); } else if(1<=x<10){ y=2*x-1; printf("%d",y); } else{ y=3*x-11; printf("%d",y); } return 0; }
相关文章推荐
- Struts2 入门(三) 之 配置文件的常量设置
- C和指针读书笔记(第七章)
- 26百度地图小总结
- vs2013+Microsoft Speech SDK 5.1+error C4996
- 51NOD 1097 拼成最小的数
- 今天给大家介绍一下SpringBoot框架中URL参数如何进行Base64加密解密
- MyEclipse 10 for mac配置JDK1.6
- 26百度地图小总结
- 【poj2546】 Circular Area
- 【poj2187】 Beauty Contest
- 梯度下降算法的C++实现
- oracle SELECT INTO 和 INSERT INTO SELECT 两种表复制语句讲解
- (笔记)Spring实战_征服数据库(3)_在Spring中使用JDBC
- 简单仿真示例
- 两种方法教你在Ubuntu下轻松关闭触摸板(TinkPad)
- 选择法---求取最大数
- hihocoder #1043 : 完全背包
- Spring-使用注解方式装配对象
- Leetcode:Next Permutation
- Android视频学习(二):数据存储与界面展示2