Rewrote for struct
This commit is contained in:
parent
e7ea212590
commit
c2e6a9accc
3 changed files with 6 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
div_t div(int x, int y) {
|
||||
div_t ret_val;
|
||||
struct div_t div(int x, int y) {
|
||||
struct div_t ret_val;
|
||||
ret_val.quot = x / y;
|
||||
ret_val.rem = x % y;
|
||||
return ret_val;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
ldiv_t ldiv(long int x, long int y) {
|
||||
ldiv_t ret_val;
|
||||
struct ldiv_t ldiv(long int x, long int y) {
|
||||
struct ldiv_t ret_val;
|
||||
ret_val.quot = x / y;
|
||||
ret_val.rem = x % y;
|
||||
return ret_val;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
lldiv_t lldiv(long long int x, long long int y) {
|
||||
lldiv_t ret_val;
|
||||
struct lldiv_t lldiv(long long int x, long long int y) {
|
||||
struct lldiv_t ret_val;
|
||||
ret_val.quot = x / y;
|
||||
ret_val.rem = x % y;
|
||||
return ret_val;
|
||||
|
|
Loading…
Reference in a new issue