#include<stdio.h>
int main()
{
  int righe, colonne, tot1=0, x, y;
  float mat[100][100];
  printf("Inserisci il numero di righe della matrice:");
  scanf("%d", &righe);
  printf("Inserisci il numero di colonne della matrice:");
  scanf("%d", &colonne);
  for(y=0;y<righe;y++)
  {
      for(x=0;x<colonne;x++)
      {
         printf("Inserisci il valore della matrice in posizione [%d] [%d]:  ", x+1, y+1);
         scanf("%f", &mat[x][y]);
      }
  }
  printf("\nLa riga con piu' elementi positivi e': %d\n", pos(mat, righe, colonne));
  system("pause");
  return 0;
}
//Implementazione della fuzione
int pos(float matrice[][100], int r, int c)
{
    int count=0, riga=0, max=0, y, x;
    for(y=0; y<r; y++)
    {
        count=0;
        for(x=0; x<c; x++)
        {
            if(matrice[x][y]>0)
                count++;
        }//Chiusura for delle x
        if(count > max)
        {
            max = count;
            riga = y;
        }
    }
    if(max > 0)
      return riga;
    else
      return -1;
}
