上机作业2-2,3,4
来源:互联网 发布:网络禁书100本百度云 编辑:程序博客网 时间:2024/04/27 12:32
2分段函数
4自动取款机# include<iostream>
using namespace std;
int main()
{
int x,z;
const int y=199710;
cin>>x;
if(x==y)
{
cout<<"1.查询\n"<<"2.取款\n"<<"3.存款\n"<<"4.转账\n"<<"0.退出\n";
cin>>z;
cout<<"谢谢,"<<"你选择了" <<z<<"号功能";
}
else
cout<<"密码错误";
return 0;
#include<iostream>using namespace std;int main(){ double x,y; cin>>x; if(x>=1) { y=x-1; cout<<y; } else { y=1-x; cout<<y; }return 0;
}
3两点距离
# include<iostream># include<cmath>using namespace std;int main(){ double x1,x2,y1,y2,a,b,c; cin>>x1>>x2>>y1>>y2; a=(x1-x2)*(x1-x2); b=(y1-y2)*(y1-y2); c=sqrt(a+b); cout<<c<<endl;}
4自动取款机# include<iostream>
using namespace std;
int main()
{
int x,z;
const int y=199710;
cin>>x;
if(x==y)
{
cout<<"1.查询\n"<<"2.取款\n"<<"3.存款\n"<<"4.转账\n"<<"0.退出\n";
cin>>z;
cout<<"谢谢,"<<"你选择了" <<z<<"号功能";
}
else
cout<<"密码错误";
return 0;
}
0 0
- 上机作业4-2
- 上机作业3-2
- 上机作业2-2,3,4
- 上机作业3-2,3,4
- 上机作业2-2
- 上机作业2
- 数据库上机作业2
- mysql上机作业2
- C++上机作业-2
- c++上机作业-2
- 上机作业5-2
- 上机作业6-2
- 上机作业7-2
- 第二周上机作业2
- 《计算机组成》上机作业2
- 第一次上机作业(2)
- c++的上机作业2
- c++第一次上机作业-2
- 皇后
- D21
- 新浪微博,按钮依次弹出动画
- 一个简单的程序教你检测你的机器是大端还是小端?
- 多台Linux服务器SSH相互访问无需密码
- 上机作业2-2,3,4
- Yii之路(第四)
- 04_item简单平移动画
- 05_item平移动画监听
- Yii之路(第五)
- c++作业3
- Qt入门(动作、布局管理器、菜工状)
- 关于Eclipse CDT中EOF的输入方式
- CocoaPods 笔记