#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
int a, b, c; // a, b, c int선언
ifstream inStream; // input 변수선언
inStream.open("input.txt"); // input 파일열기
ofstream outStream; // output 변수선언
outStream.open("output.txt"); // output 파일열기
inStream >> a >> b; // input 파일의 a, b 읽기
c = a + b ;
outStream << a << " and " << b << " add up to " << c << ".";
// output 파일에 계산된 문자열 넣기
inStream.close(); // input 닫기
outStream.close(); // output 닫기
return 0;
}
// 영남이공대학교 사이버보안과
'언어 > _C프로그래밍(알고캠퍼스)' 카테고리의 다른 글
알고캠퍼스 C++ 10급 20차시 변수의 활용 문제풀기 답 (0) | 2014.09.12 |
---|---|
알고캠퍼스 C++ 10급 21차시 증가법 예제 설명 (0) | 2014.09.12 |
10급 15차시 문제2번 백년계산 (0) | 2014.08.30 |
10급 15차시 3번문제 다리 수 세기 (0) | 2014.08.30 |
VC++ 입문 10급 15차시/ 할당문2 사다리꼴 문제 답 (0) | 2014.08.30 |