Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
abraham
#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
Simulare 2022
Stream8
qwerty
Interest Compounding
Test
Binary Search
4149 coj WIP
isBST
replace-30-Seconds-of-C++
infix to postfix v 5.0 (with exponent support)