文章

34

粉丝

9

获赞

5

访问

8.9k

头像
细菌繁殖问题 题解:数学问题
P5126
发布于2024年6月29日 14:20
阅读数 216

#include <iostream>

using namespace std;

int main(){
	int n;
	
	cin >> n;
	
	while(n --){
		int x;
		cin >> x;
		cout << x * x + (2 * x - 2 ) * (x - 1) / 2 << endl;
	} 
	return 0;
}

 

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发