Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
2
#include <iostream> using namespace std; int main() { int ile=0; scanf("%d",&ile); for(int i=0; i<ile; i++) { int liczba=0; scanf("%d",&liczba); int tab[44]; int wynik=0; for(int n=1; n<=liczba; n++) { if(n<=3) { tab[n]=n; } else { tab[n]=(2*tab[n-2]+3*tab[n-1]+5)%987; } wynik = tab[liczba]; } printf("%d\n",wynik); } }
run
|
edit
|
history
|
help
0
Merge overlapping time intervals
HashMap
ad
Generating π from 1,000 random numbers
Mine
Substring search
pow implementation
Addition of two matrix **Part 1
Rzutka gra 2
Web Browser History