首页 > 编程 > C++ > 正文

c++作业一

2019-11-06 07:02:37
字体:
来源:转载
供稿:网友
一、问题及代码
#include<iostream>#include<cmath>int main(void){	using namespace std; 	int x1,y1,x2,y2;	int a,b;	double l;	cin>>x1>>y1>>x2>>y2;	l=sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));	cout<<l<<endl;	return 0;	}

二、运算结果

三、问题及代码

#include<iostream>#include<cmath>int main(void){	using namespace std; 	float weight,height,standard;	cin>>height>>weight;	standard=height-100;	if(weight>(standard+standard*0.2))	cout<<"超重"<<endl;	else if(weight<(standard-standard*0.2))	cout<<"超轻"<<endl;	else cout<<"正常"<<endl;	return 0;	}

四、运算结果


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表

图片精选