daily pastebin goal
53%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int foo(int *m, int i, int j){
  5.     int s,o,c;
  6.     int jo;
  7.     jo=0;
  8.     if(i!=j)
  9.         return 0;
  10.     for(s=0;s<i;s++){
  11.         for(o=0;o<j;o++)
  12.             if(m[s*i+o]== m[o*i+s])
  13.                 jo++;
  14.  
  15.     }
  16.  
  17.     c=i*j;
  18.     if(jo==c)
  19.         return 1;
  20.     else
  21.         return 0;
  22.  
  23. }
  24. /*
  25. int main()
  26. {
  27.     int m[3][3] = {{1, 2, 3},
  28.                    {2, 3, 1},
  29.                    {3, 1, 2}};
  30.     if (foo(&m[0][0], 3, 3))
  31.         puts("YES");
  32.     else
  33.         puts("NO");
  34.     return EXIT_SUCCESS;
  35. }
  36.  
  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