Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 다익스트라 알고리즘(Dijkstra Algorithm)
- 동적 프로그래밍(Dynamic Programming)
- 백준 1948번
- 이분 그래프(Bipartite Graph)
- 백준 2493번
- 백준 2812번
- 플로이드 워셜 알고리즘(Floyd-Warshall Algorithm)
- 백준 18352번
- 백준 17608번
- 알고리즘 개념
- 스택(Stack)
- 위상 정렬(Topological Sort)
- DFS(Depth First Search)
- 그래프(Graph)
- 위상 정렬(Topology Sort)
- 트리(Tree)
- DFS & BFS
- DFS
- 큐(Queue)
- 백준 2504번
- 분할 정복(Divide and Conquer)
- 백준 9012번
- 백준 21606번
- 백준 10000번
- 그리디 알고리즘(Greedy Algorithm)
- 이분 탐색(Binary Search)
- BFS(Breadth First Search)
- 백준 2261번
- 백준 1707번
- BFS
Archives
- Today
- Total
Always Be Wise
반복문 본문
728x90
C 언어에서의 반복문은 for 문과 while 문, do while 문이 있다.
for 문은 반복 횟수가 정해져 있을 때, while 문은 반복 조건이 정해져 있을 때, do while 문은 저거도 한 번 실행될 내용을 정해 놓고
while 문을 적용하려 할 때 사용한다.
#include <stdio.h>
int main()
{
for(int i=0; i<5; i++)
{
printf("Hello, world!\n");
}
return 0;
}
int main()
{
int i = 0;
while(i<5)
{
printf("Hello, world!\n");
i++;
}
return 0;
}
#include <stdio.h>
int main()
{
int i = 0;
do
{
printf("Hello, world!\n");
i++;
}
while(0<i && i<5);
return 0;
}
Comments