include <stdlib.h>
div_t div(int numerator, int denominator);
typedef struct {
int quot;
int rem;
} div_t;
#include <stdio.h>
#include <stdlib.h>
int main()
{
div_t result;
result = div(38, 5);
printf ("Quotient = %d, remainder = %d\n", result.quot, result.rem);
return 0;
}
./div
Quotient = 7, remainder = 3
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |