Untitled

mail@pastecode.io avatar
unknown
c_cpp
2 months ago
1.3 kB
1
Indexable
Never
#include <iostream>
using namespace std;


int step(int k, int p) {
	int sum = k;
	for (int i = 1; i < p; i++)
	{
		sum *= k;

	}
	return sum;
}
int krytoi(int kub, int p, int htanga) {
	int k;
	 k = (kub + htanga);
	int k2 = step(k, p);
	return k2;
}

/*
.
⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⣀⡤⢦⡀⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠄⢀⡴⠋⠁⠄⠄⢳⡄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⣰⡟⢠⣤⣶⢄⣴⠿⠃⠄⠄
⠄⠄⠄⠄⠄⢀⣼⠏⢠⣿⠁⠈⠉⠄⠄⠄⠄⠄
⠄⠄⠄⠄⢠⡾⠃⢠⣿⡇⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⣰⡟⠁⠄⣿⣿⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⣴⡟⠄⠄⢠⣿⣿⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⣼⡿⠄⠄⠄⣸⣿⡏⣠⣴⠶⠶⠶⢶⣤⣀⣴
⢸⡏⡅⠄⠄⢠⣿⣿⡿⠋⠄⠄⠄⠄⠄⠙⣿⣿
⢸⡇⠄⠄⢠⣿⡿⠟⠁⢀⠄⠄⠄⠄⠄⣠⣿⣿
⢸⡇⠄⠄⠄⠄⠄⠄⠄⠄⠙⢶⣶⣶⣿⣿⣿⣿
⠈⠛⠷⣶⣶⣤⣤⣤⣤⠤⠄⣀⣠⣴⣿⣿⣿⣿
⠄⠄⠄⠄⠉⠙⠛⠿⠿⠿⠿⠿⠿⠿⠟⠛⠋⠉*/

int main() {
	int kub, p, htanga;               /*kub - кубики
	                                   p - пятерки
									   htanga - штанга            */
	cin >> kub >> p >> htanga;
	cout << krytoi(kub, p, htanga);
}
Leave a Comment