2020-11-13

#include <iostream>
using namespace std;
int main() {
	int a,b,c,d;
	cin >> a>> b>>c;
	if (a < b) {
		d= b;
		b = a;
		a = d;
	}
	if (b < c) {
		d = c;
		c = b;
		b = d;
	}
	if (a < b) {
		d = b;
		b = a;
		a = d;
	}
	cout << a<<" "<<b<<" "<<c;
	return 0;
}
#include <iostream>
using namespace std;
int main() {
	int n;
	cin >> n;
	for (int c = 0;c <= (n- 1);c++) {
		for (int b = n - 1-c;b > 0;b--) {
			cout << " ";
		}
		for (int e = 0;e < 1 + 2 * c;e++) {
				cout << "*";
			}
		cout << endl;
	}
	for (int c = n-2;c >=0;c--) {
		for (int b = 0;b <n-c-1;b++) {
			cout << " ";
		}
		for (int e = 0;e < 1 + 2 * c;e++) {
			cout << "*";
		}
		cout << endl;
	}

	return 0;
}
#include <iostream>
using namespace std;
int main() {
	int arr[] [5]= { 1,2,3,4,5,2,4,6,8,10,3,6,9,12,15,4,8,12,16,20 };
	for (int a = 0;a < 4;a++) {
		for (int b = 0;b < 5;b++) {
			cout << arr[a][b]<<" ";
		}
		cout << endl;
	}
	return 0;
}
#include <iostream>
using namespace std;
int main() {
	int a,b;
	b = 0;
	while (1) {
		cin >> a;
		if (a < 0) {
			break;
		}
		for (int i = 1;i <= a;i++) {
			b =b+i;
		}
		cout << b<<endl;
		b = 0;
	}
	return 0;
}
#include <iostream>
using namespace std;
int main (){
	int b, c,d;
	for (int a = 100; a < 1000 ;a++) {
		b = a % 10;
		c =( a/10) % 10;
		d = a / 100;
		if (d*d*d + b * b*b + c * c*c == a) {
			cout << a<<" ";
		}
	}
	}
#include <iostream>
#include <cmath>
using namespace std;
int main() {
	int a, b, c,d,e;
	cin >> a >> b >> c;
	e = (a + b + c) / 2;
	if (e <= a || e <= b || e <= c) {
		cout << "你管这叫三角形?";
		return 0;
	}
	d = sqrt(e*(e - a)*(e - b)*(e - c));
	cout << d;
	return 0;
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值