fork download
  1. #include <stdio.h>
  2. int row (int a[][],int i,int j)
  3. {
  4. int c;
  5. if(a[i][j]<=a[i][j])
  6. c=0;
  7. else
  8. c=1;
  9. return c;
  10. }
  11. int col (int a[][],int i,int j)
  12. {
  13. int c;
  14. if(a[i][j]>=a[i][j])
  15. c=0;
  16. else
  17. c=1;
  18. return c;
  19. }
  20. int main(void) {
  21. int t,i,j,count,m,n,c;
  22. long int a[500][500];
  23. i=0;j=0;
  24. scanf("%d",&t);
  25. printf("\n");
  26. scanf("%d%d",&m,&n);
  27. for(i=0;i<=m;i++)
  28. {
  29. for(j=0;j<=n;j++)
  30. {
  31. scanf("%ld"a[i][j]);
  32. }
  33. }
  34. count=1;
  35.  
  36. do{
  37. do {
  38. c=row(a[][],i,j);
  39. if(c=0)
  40. c=row(a[][],i,j);
  41. count++;
  42. j++;
  43. }while(i!=m);
  44. do {
  45. c=col(a[][],i,j);
  46. if(c=0)
  47. c=col(a[][],i,j);
  48. count++;
  49. i++;
  50. }while(j!=m);
  51. }while(i=m&&j=n);
  52. return 0;
  53. }
  54.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
2
2 3
2 1 1
2 1 1

compilation info
prog.c:2:14: error: array type has incomplete element type 'int[]'
 int row (int a[][],int i,int j)
              ^
prog.c:11:14: error: array type has incomplete element type 'int[]'
 int col (int a[][],int i,int j)
              ^
prog.c: In function 'main':
prog.c:31:15: error: expected ')' before 'a'
    scanf("%ld"a[i][j]);
               ^
prog.c:31:10: warning: format '%ld' expects a matching 'long int *' argument [-Wformat=]
    scanf("%ld"a[i][j]);
          ^
prog.c:38:11: error: expected expression before ']' token
   c=row(a[][],i,j);
           ^
prog.c:38:9: error: type of formal parameter 1 is incomplete
   c=row(a[][],i,j);
         ^
prog.c:39:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if(c=0)
   ^
prog.c:40:10: error: expected expression before ']' token
  c=row(a[][],i,j);
          ^
prog.c:40:8: error: type of formal parameter 1 is incomplete
  c=row(a[][],i,j);
        ^
prog.c:45:11: error: expected expression before ']' token
   c=col(a[][],i,j);
           ^
prog.c:45:9: error: type of formal parameter 1 is incomplete
   c=col(a[][],i,j);
         ^
prog.c:46:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   if(c=0)
   ^
prog.c:47:10: error: expected expression before ']' token
  c=col(a[][],i,j);
          ^
prog.c:47:8: error: type of formal parameter 1 is incomplete
  c=col(a[][],i,j);
        ^
prog.c:51:15: error: lvalue required as left operand of assignment
  }while(i=m&&j=n);
               ^
prog.c:22:11: warning: variable 'a' set but not used [-Wunused-but-set-variable]
  long int a[500][500];
           ^
stdout
Standard output is empty