Created
March 20, 2014 04:35
-
-
Save rodrigoalvesvieira/9657331 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int recursion(int n) | |
{ | |
if (n == 1) return 7; | |
return recursion(n-1) + 5; | |
} | |
int main() | |
{ | |
int N; | |
while(scanf("%d", &N), N != 0) { | |
printf("%d\n", recursion(N)); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment