" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2025 KUDO.TIPS - All rights reserved.
#include <iostream>
using namespace std;
int power(int x, int n) {
if (n == 1) {
return x;
}
else {
return x*power(x,n-1);
}
}
int main() {
int x,n;
cin >> x;
cin >> n;
cout << power(x,n) << endl;
return 0;
}
/* ZADANIE 4 */
#include <iostream>
using namespace std;
int main() {
int fibb[5] = {1,1,2,3,5};
int fibb_sum = 0;
for (int i=0; i<5; i++) {
fibb_sum += fibb[i];
}
int multiplier;
int n;
cin >> n;
multiplier = (int) ((float)n / (float)fibb_sum + 0.5);
cout << "{";
for (int i=0; i<5; i++) {
fibb[i] *= multiplier;
cout << fibb[i] << "-";
}
cout << "\b}\n";
return 0;
}