typedef struct re
{
int q;
int r;
}R ;
R div(int a,int b)
{
int c;
R res;
res.q=0;
c=b;
do{
a-=b;
res.q++;
}while(a>=c);
res.r=a;
return res;
}
int main()
{
R r;
int x=542,y=10;
r=div(x,y);
printf("/nquotient:%d/tdremainder:%d/n",r.q,r.r);
getch();
return 0;
}