Skip to content

Instantly share code, notes, and snippets.

@josejuan
Created June 22, 2012 22:57
Show Gist options
  • Save josejuan/2975644 to your computer and use it in GitHub Desktop.
Save josejuan/2975644 to your computer and use it in GitHub Desktop.
serie geométrica tonta
// Cálculo ingenuo de una serie geométrica:
int Calculo(int a, int r, int n) {
int R = 1, S = 0;
while(n--) {
S += a * R;
R *= r;
}
return S;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment