Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
aaaaaaaaaaaa
#include <iostream> using namespace std; int x,k; int abr(int x) { if(x==1) {return 7;} else if(x==0) {return 0;} if(x%2==0)//parzyste {k=5;} else if(x%2>0)//nieparzyste {k=3;} return abr(x-1)+k*(abr(x-1)-abr(x-2)); } int testy,pok; int main() { cin>>testy; for(int i=0;i<testy;i++) { cin>>pok; cout<<abr(pok)<<endl; } }
run
|
edit
|
history
|
help
0
Stock buy/sell, maximum subarray problem
reverse linked list
list
isBST
Change a coin with one,two,five coins (print all ways)
19 მარტს დამუშავებული
12/13 quiz shickes
completed
Extended Euclidean Algorithm
Big O Notation array problem