Advertisement
lukasd

kolos 1 zadanie 5

Feb 4th, 2018
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.26 KB | None | 0 0
  1. int czebyszew(int x, int k)
  2. {
  3.     if (k == 0)
  4.     {
  5.         return 1;
  6.     }
  7.     if (k == 1)
  8.     {
  9.         return x;
  10.     }
  11.     return 2 * x*czebyszew(x,k - 1) - czebyszew(x,k - 2);
  12.     }
  13. void kolos1()
  14. {
  15.     int x;
  16.     int k;
  17.     scanf("%d", &x);
  18.     scanf("%d", &k);
  19.     printf("%d", czebyszew(x,k));
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement