Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.95 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <locale.h>
  3. #include <stdlib.h>
  4.  
  5.  
  6. int main()
  7. {
  8.     setlocale (LC_CTYPE, "RUSSIAN");
  9.  
  10.     int k=0,p=0,ot=0;
  11.     int i,j;
  12.     int m,n;
  13.  
  14.     printf("Введите количество строк= ");
  15.     scanf("%d",&m);
  16.     printf("Введите количество столбцов= ");
  17.     scanf("%d",&n);
  18.  
  19.     int a[m][n];
  20.  
  21.     for(i=0;i<m;i++)
  22.     {
  23.         for (j=0;j<n;j++)
  24.  
  25.        {
  26.            printf("Введите элементы [%d][%d]= ",i+1,j+1);
  27.         scanf("%d",&a[i][j]);
  28.        }
  29.     } printf("\n");
  30.  
  31.  
  32.    for (i=0;i<m;i++)
  33.    {
  34.        printf("\n");
  35.        for (j=0;j<n;j++)
  36.        {
  37.          printf("%4d",a[i][j]);
  38.        }
  39.    }
  40.   for (i=0;i<m;i++)
  41.   {
  42.       for (j=0;j<n;j++)
  43.       {
  44.         while(a[i][j]!=0)
  45.       {
  46.           if (a[i][j]>0)
  47.           printf("%d",i,j);
  48.             p++;
  49.           else if (a[i][j]<0)
  50.             ot++;
  51.       }
  52.   }
  53.  
  54.  
  55.  
  56. return 0;
  57.  
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement