Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <fcntl.h>
- #include <limits.h>
- #include <unistd.h>
- int main(int argc, char *argv[]) {
- int max1 = INT_MIN;
- int max2 = INT_MIN;
- for(int i = 1; i < argc; ++i) {
- int in = open(argv[i], O_RDONLY);
- char c[20];
- while(read(in, c, 20)) {
- int a;
- sscanf(c + 16, "%d", &a);
- printf("%d\n", a);
- if(a >= max1) {
- max2 = max1;
- max1 = a;
- } else if(a > max2) {
- max2 = a;
- }
- }
- }
- float ans = (float) max2 / 100;
- printf("%.2f\n", ans);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement