Skip to content

Instantly share code, notes, and snippets.

@salvianoo
Created May 19, 2012 22:01
Show Gist options
  • Save salvianoo/2732526 to your computer and use it in GitHub Desktop.
Save salvianoo/2732526 to your computer and use it in GitHub Desktop.
n3
#include <iostream>
using namespace std;
int main (int argc, char * const argv[]) {
double H = 0;
cout << "Digite um valor para obter o calculo de H ..." << endl;
int N;
scanf("%d", &N);
for(double cont = 1; cont <= N; cont++) {
H += 1 / cont;
}
cout << "H = "<< H;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment