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
fibonacci
ExceptionHandling4
Metodos
Conjuntos - Contar caracteres únicos
顺序表的实现——静态分配
Vec+Mem+Adv_11
floyd alfa 2
Using C's sprinf() Function to Format Output String
find parent count of node in graph
Longest Consecutive Subsequence