<pre name="code" class="cpp">#include<cmath>
#include<iostream.h>
void main()
{
int x1,y1,x2,y2,a;
cout<<"输入坐标1:";
cin>>x1>>y1;
cout<<"输入坐标2:";
cin>>x2>>y2;
a=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
cout<<"距离:"<<sqrt(a);
}
#include<iostream.h>
void main()
{
int c,d;
cout<<"陈氏银行欢迎您";
cout<<"请输入密码:";
cin>>c;
if(c==960720)
{
cout<<"1.查询 2.取款 3.存款 4.转帐 0.退出"<<endl;
cin>>d;
if(d=1)
cout<<"谢谢,您选择了 1 号功能";
else if(d=2)
cout<<"谢谢,您选择了 2 号功能";
else if(d=3)
cout<<"谢谢,您选择了 3 号功能";
else if(d=4)
cout<<"谢谢,您选择了 4 号功能";
else if(d=0)
cout<<"谢谢,您选择了 0 号功能";
}
else
cout<<"谢谢,请重输";
}
#include <iostream.h>void main(){int x,y;cout<<"输入x:";cin>>x;if(x<1){cout<<"y="<<1-x<<endl;}else {cout<<"y="<<x-1<<endl;}}