您的位置:首页 > 其它

第三次实验作业

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;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: