第三次实验作业
2016-03-28 16:38
417 查看
#include <iostream> #include<cmath> using namespace sth; { float x1,y1,x2,y2,d; cout<<"输入两个点坐标:"<<endl; cin>>x1>>y1>>x2>>y2; d=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) cout<<"两点距离:"<<d<<endl; return 0 } #include<iostream> using namespace std; int main() { int password,x; cout<<"荣氏银行欢迎您,请输入密码"<<endl; cin>>password; if( password==888888) { cout<<"请选择功能"<<endl; cin>>x; switch(x) { case 1:cout<<"谢谢,您选择了查询功能"<<endl; case 2:cout<<"谢谢,您选择了取款功能"<<endl; case 3:cout<<"谢谢,您选择了存款功能"<<endl; case 4:cout<<"谢谢,您选择了转账功能"<<endl; case 5:cout<<"谢谢,您选择了退出功能"<<endl; } } else { cout<<"您输入的密码有误"<<endl; } return 0; } #include<iostream> using namespace std; int main() { double x,y; cin>>x; if (x>=1) { y=x-1; cout<<y<<endl; } else { y=1-x; cout<<y<<endl; } return 0; }
相关文章推荐
- java产生随机数
- IntelliJ IDEA快捷键
- 打印1到最大的n位数
- swift user guide.pdf下载
- C# fixed详解
- linux开机启动流程
- Linux SPI总线和设备驱动架构之一:系统概述
- 【ValidationTools】去除工程模式下某项测试
- [组合&计数]
- BZOJ2351Matrix
- selenium + python自动化测试环境搭建
- PyQt5(2)——窗口属性修改和控件
- 酒店房间管理系统模拟实现
- Java排序算法——冒泡排序
- VS 的Command Window命令
- NDK 配置及简单项目
- Javascript 深度克隆
- cocos2dx工程 配置图标(Icon)和启动图(LaunchImage)的方式
- google glog
- String转Float问题