Created
May 17, 2015 12:52
-
-
Save Baekjoon/108b70d1d73e53dfda02 to your computer and use it in GitHub Desktop.
7-2.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main() { | |
// 1부터 10까지 출력하는 프로그램 | |
int i = 1; // 초기값 | |
while (i <= 10) { // 조건 | |
cout << i << endl; // 해야할 일 | |
i++; // 변경 | |
} | |
// 10부터 1까지 출력하는 프로그램 | |
i = 10; | |
while (i >= 1) { | |
cout << i << endl; | |
i--; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment