Mình bị lỗi như sau [Error] cannot convert 'int (*)[100]' to 'int*' for argument '1' to 'void nhap(int*, int&)'
mọi người xem giúp mình ạ
#include <stdio.h>
#include <math.h>
#include <iostream>
#define N 100
void nhap(int a[],int &n)
{
printf("nhap so luong cua mang:");
scanf("%d",&n);
for(int i=0;i<n;i++)
scanf("%d",&a[i]);
}
void chuyen(int a[],int n,int b[][N],int x,int y)
{
x=sqrt(n);
int t=0;
while(t=0)
{
y=n/x;
if(y*x==n) t++;
else x++;
}
for(int i=0;i<x;i++)
for(int j=0;j<y;j++)
b[i][j]=a[j+i*x];
}
void xuat(int b[][N],int x,int y)
{
for(int i=0;i<x;i++)
{
for(int j=0;j<y;j++)
printf("%d\t",b[i][j]);
printf("\n");
}
}
int main()
{
int a[N][N],b[N],n,x,y;
nhap(a,n);
chuyen(a,n,b,x,y);
xuat(b,x,y);
return 0;
}