Skip to content

Commit

Permalink
10.07
Browse files Browse the repository at this point in the history
  • Loading branch information
lemon5920 committed Oct 9, 2016
1 parent 7472072 commit 9171606
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.out
.DS_Store
11 changes: 11 additions & 0 deletions harmonic.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#include <stdio.h>
int main() {
int n;
float sum = 0;
scanf("%d", &n);
for(float i = 1; i <= n; i++) {
sum += (1/i);
}
printf("%f\n", sum);
return 0;
}
13 changes: 13 additions & 0 deletions max.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include <stdio.h>
int main() {
int n, i, max = 0, tmp;
scanf("%d", &n);
for(i = 0; i < n; i++) {
scanf("%d", &tmp);
if(tmp > max) {
max = tmp;
}
}
printf("%d\n", max);
return 0;
}

0 comments on commit 9171606

Please # to comment.