Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- float min(float a, int n);
- float max(float a, float b);
- float T();
- const int NMax = 100;
- int main()
- {
- int n;
- float a[NMax], b[NMax], c[NMax];
- FILE* file;
- fopen_s(&file, "in.txt", "r");
- fscanf_s(file, "%d", &n);
- for (int i = 0; i < n; i++)
- fscanf_s(file, "%f", &a[i]);
- for (int i = 0; i < n; i++)
- fscanf_s(file, "%f", &b[i]);
- for (int i = 0; i < n; i++)
- fscanf_s(file, "%f", &c[i]);
- fclose(file);
- }
- float min(float* a, int n)
- {
- float m = a[0];
- for (int i = 1; i < n; i++)
- if (a[i] < m)
- m = a[i];
- return m;
- }
- float max(float* a, int n)
- {
- float m = a[0];
- for (int i = 1; i < n; i++)
- if (a[i] > m)
- m = a[i];
- return m;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement