Skip to content

Instantly share code, notes, and snippets.

@rbakbashev
Last active October 14, 2016 17:54
Show Gist options
  • Select an option

  • Save rbakbashev/3226bf8fbdbfe7a70f2adfe262233775 to your computer and use it in GitHub Desktop.

Select an option

Save rbakbashev/3226bf8fbdbfe7a70f2adfe262233775 to your computer and use it in GitHub Desktop.
#include <fstream>
int S(int n) {
return n == 1 ? 1 : 2 * S(n - 1) + 1;
}
int main() {
int n;
printf("Enter n: ");
scanf("%d", &n);
printf("S(%d) = %d\n", n, S(n));
}
@mourvan
Copy link

mourvan commented Jun 2, 2016

vashe shikarno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment