Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int array[3] = {0,0,1};
- bool find_1(int j)
- {
- if(j < 3)
- {
- if(array[j] == 1)
- return 1;
- else
- return find_1(j+1);
- }
- else
- {
- return 0;
- }
- }
- int main()
- {
- if(find_1(0))
- printf("Got Gold\n");
- else
- printf("Got Nothing\n");
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment