S1
时间:2010-09-13 来源:luozhiyong131
/*
计算矩形周长,面积;
*/ #include <iostream.h> void main(){
int width, height, girth,area;
cout << "请输入矩形宽,高:";
cin >> width >> height;
girth = (width + height)*2;
area = width * height;
cout << "矩形宽=" << width << "高=" << height << endl;
cout << "周长=" << girth << endl;
cout << "面积=" << area << endl;
}
计算矩形周长,面积;
*/ #include <iostream.h> void main(){
int width, height, girth,area;
cout << "请输入矩形宽,高:";
cin >> width >> height;
girth = (width + height)*2;
area = width * height;
cout << "矩形宽=" << width << "高=" << height << endl;
cout << "周长=" << girth << endl;
cout << "面积=" << area << endl;
}
相关阅读 更多 +