Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int rec(){
- int n;
- static int count=1;
- scanf("%d\n", &n);
- if(count == 0 && n ==0)
- return 0;
- count= n;
- return (n==1)+rec();
- }
- int main(){
- printf("%u", rec());
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement