daily pastebin goal
81%
SHARE
TWEET

Untitled

a guest Jun 14th, 2018 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. int Brojac(int niz[], int n, int k)
  3. {
  4.     int i, br=0;
  5.     for(i=0;i<n;i++)
  6.     {
  7.         if(niz[i]==k)
  8.             br++;
  9.     }
  10.     return br;
  11. }
  12. main()
  13. {
  14.     int N, M, A[50][50], B[50], j;
  15.     printf("N: ");
  16.     scanf("%d", &N);
  17.     printf("M: ");
  18.     scanf("%d", &M);
  19.  
  20.     for(i=0;i<N;i++)
  21.         for(j=0;j<M;j++)
  22.             scanf("%d", A[i][j]);
  23.    
  24.  
  25.     for(j=0;j<M;j++)
  26.     {
  27.         br=Brojac(A[], N, 1);
  28.         B[j]=br;
  29.     }
  30.    
  31.     for(i=0;i<M;i++)
  32.     {
  33.         printf("%d", B[i]);
  34.     }
  35.  
  36. getch();
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top