Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cmath>
- #include <iostream>
- using namespace std;
- int main(void) {
- fstream input;
- fstream output;
- output.open("output.txt", fstream::out);
- double a[10][10];
- for (size_t i = 1; i < 11; i++)
- {
- for (size_t j = 0; j < 11; j++)
- {
- a[i - 1][j - 1] = (10 - pow(j - 5, 2)) * pow(i - 5, 2);
- cout << a[i - 1][j - 1] << " ";
- }
- cout << endl;
- }
- double b[10], c[10], k[10];
- for (size_t i = 0; i < 10; i++)
- {
- b[i] = a[i][0];
- for (size_t j = 1; j < 10; j++) if (b[i] > a[i][j]) b[i] = a[i][j];
- }
- for (size_t j = 0; j < 10; j++)
- {
- c[j] = a[0][j];
- k[j] = 1;
- for (size_t i = 1; i < 10; i++)
- {
- if (c[j]<a[i][j])
- {
- c[j] = a[i][j];
- k[j] = i;
- }
- }
- }
- int d = 0;
- for (size_t j = 0; j < 10; j++)
- {
- for (size_t i = 0; i < 10; i++)
- {
- if (b[j]==c[i] && j==k[i])
- {
- output << j << "\n";
- output << i << "\n";
- output << c[i] << "\n";
- }
- }
- }
- output.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement