最終更新日時(UTC):
が更新

履歴 編集

class
<cstdlib>

std::lldiv_t(C++11)

namespace std {
  struct lldiv_t {
    long long quot;
    long long rem;
  };
}

概要

std::div()関数のlong long版の戻り値。

quotは「quotient (商)」、remは「remainder (剰余)」。

#include <iostream>
#include <cstdlib>

int main()
{
  std::lldiv_t x = std::div(5LL, 2LL);
  std::cout << x.quot << std::endl;
  std::cout << x.rem << std::endl;
}

出力

2
1