
[241226 TIL] C++ 공부_입력 예외 처리
·
TIL
0️⃣ New Knowledge▪ rand() 함수#include#includerand() % 3; //0~2 중 랜덤한 수▪ 반올림 : round(number) ▪ accumulate(first, last, init, op): 컨테이너의 요소를 효율적으로 누적하거나, 원하는 방식으로 처리하는 데 사용 기본 연산은 더하기(+), 필요 시 사용자 정의 연산 가능 -> opvector numbers = {1,2,3,4,5};int product = accumulate(numbers.begin(), numbers.end(), 1, [](inta,intb) {return a * b});// 곱셈 연산vector words = {"Hello"," ","World","!"};string result =accu..