C language question: Find the "saddle point" of a two-dimensional array, that is, the element at the position is the largest on the row and the smallest on the column. Or there may be no saddle points.

Source: Internet
Author: User

1 // question: Find the "saddle point" of a two-dimensional array, that is, the element at this position is the largest on the row and the smallest on the column. Or there may be no saddle points. 2 // 3 # include "stdio. h "4 # include <stdlib. h> 5 int main () 6 {7 int I, j, k, hang = 1, lie = 1; 8 printf ("input row "); 9 scanf ("% d", & hang); 10 printf ("input column"); 11 scanf ("% d", & lie ); 12 printf ("Enter the elements of the matrix, input the elements from left to right in the row, input the elements from top to bottom between lines, and input the elements by pressing enter: \ n "); 13 int zong = hang * lie; 14 15 int * a; 16 a = (int *) malloc (zong * sizeof (int )); 17 printf ("Enter % d elements:", zong); 18 for (I = 0; I <zong; I ++) 19 scanf ("% d ", & a [I]); 20 printf ("\ B \ n "); 21 22 int ** data; 23 24 25 data = (int **) malloc (hang * sizeof (int *); 26 for (int j = 0; j 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.