Computer Science/C++6 C++ -5- 홀수 짝수 판별 프로그램 #include using namespace std; int main() { while(1) { int a; cin >> a; if (a % 2 == 0) cout 2021. 4. 7. C++ -4- While 반복문과 함수를 이용한 간단한 덧셈 계산기 #include using namespace std; int plus5(int num_a, int num_b) { int sum = num_a + num_b; return sum; } int main() { while (1) { int x, y; cin >> x >> y; cout 2021. 4. 5. C++ -3- 함수와의 첫 만남 #include using namespace std; int multiplyNumbers(int num_a, int num_b) { int sum = num_a * num_b; return sum; } int main() { cout 2021. 4. 5. C++ -2- 입출력 스트림과의 첫 만남 #include // cout, cin, endl, .... #include // prinf int main() { using namespace std; //네임스페이스 std를 사용하면 std::를 생략할 수 있다 int x = 1024; double pi = 3.141592; cout 2021. 4. 5. 이전 1 2 다음