C++, 5.흐름제어

이도현·2023년 8월 9일
0

1. if

참 일 때 출력

2. switch-case

case마다 지정된 변수 출력

3. goto

조건에 맞을 경우 tryagain:으로 돌아가기

4. while

조건에 맞으면 반복

5. do-while

do를 마친후 while 반복

6. for

조건에 맞게 반복

7. break

반복을 마치고 끝냄

8. continue

반복을 정지하고 처음으로 돌아가서 다시 반복

9. #include // std::srand, std::rand

컴퓨터는 난수를 생성할 수 없다. 난수의 원리와 난수를 쓰는 법을 알아보자.

예제
https://github.com/DoHyeonCP/Cpp_Study/blob/main/%ED%9D%90%EB%A6%84%EC%A0%9C%EC%96%B4Controlflow

profile
좋은 지식 나누어요

0개의 댓글