Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int pitaj(int x) {
  6.   static int broj;
  7.   static int cnt = 0;
  8.   if (++cnt == 1) {
  9.     srand(time(0));
  10.     broj = rand();
  11.   }
  12.  
  13.   if (x < broj) return -1;
  14.   if (x > broj) return 1;
  15.  
  16.   printf("tocno! broj pitanja: %d\n", cnt);
  17.   exit(0);
  18. }
  19.  
  20. int main() {
  21.   // ovdje ti dopuni
  22.  
  23.   return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement