Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <math.h>
- int main(void) {
- const char * fname = "test.dat";
- char line[BUFSIZ];
- double amp, time, max, max_abs = 0;
- FILE *in = fopen(fname, "r");
- while (fgets(line, BUFSIZ, in)) {
- sscanf(line, "%lf%lf", &time, &);
- if (fabs(amp) > max_abs) {
- max = amp;
- max_abs = fabs(max);
- }
- }
- fclose(in);
- printf("max: %.7lf\n", max);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement