Advertisement
Guest User

Untitled

a guest
Jun 18th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int rec(){
  4. int n;
  5. static int count=1;
  6. scanf("%d\n", &n);
  7. if(count == 0 && n ==0)
  8. return 0;
  9. count= n;
  10. return (n==1)+rec();
  11.  
  12. }
  13.  
  14. int main(){
  15. printf("%u", rec());
  16. return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement