공순이의 블로그

고정 헤더 영역

글 제목

메뉴 레이어

공순이의 블로그

메뉴 리스트

  • 홈
  • 태그
  • 방명록
  • 분류 전체보기 (109)
    • 머신러닝 (13)
    • 파이썬 (26)
    • cmd (3)
    • terminal (22)
    • Pandas (1)
    • rviz (1)
    • c++ (8)
    • 문서 (4)
    • tensorflow (2)
    • Cakewalk (1)
    • IT 용어 (1)
    • PyTorch (3)
    • photoshop (1)
    • VSCode (2)
    • 3D Printing (1)
    • java (2)
    • OpenGL (1)
    • git (2)
    • MSYS2 (1)
    • React (0)
    • Mesh Segmentation (0)

검색 레이어

공순이의 블로그

검색 영역

컨텐츠 검색

조건문 물음표

  • Ternary if statement

    2020.07.19 by Riella

Ternary if statement

There is a short way to write if statement: ternary if statement. The format is that (condition) ? [if true, here] : [if false, here] When using in cout, make sure to use parenthesis like below code. #include #include #include using namespace std; int main() { string weather = "sunny"; double humid = 0.7; weather = (humid > 0.5) ? "rainy" : "sunny"; cout

c++ 2020. 7. 19. 00:45

추가 정보

인기글

최신글

페이징

이전
1
다음
TISTORY
공순이의 블로그 © Magazine Lab
페이스북 트위터 인스타그램 유투브 메일

티스토리툴바