#include <iostream>
#include <string>
#include <fstream>
using namespace std;

int main()
{
 ifstream f;
 string eng, kor, answer;
 int o = 0, x = 0;

 f.open("answer.txt");

 while(!f.eof())
 {
  f >> eng >> kor;
  cout << eng << endl;
  cout << "답 입력 : ";
  cin >> answer;
  if(kor == answer)
  {
   cout << "맞았습니다." << endl;
   o++;
  }
  else
  {
   cout << "틀렸습니다." << endl;
   x++;
  }
 }
 cout << "정답개수 : " << o << ", 오답개수 : " << x << endl;

 f.close();


 return 0;
}
 

 

answer.txt

 

'프로그래밍언어 > C & CPP' 카테고리의 다른 글

Visual Studio 2008 Express 다운로드 링크  (0) 2016.06.04
뽑기 게임 실습  (0) 2015.02.26
C++ 중간정리 실습 - 분산  (0) 2015.02.11
C++ 중간정리 실습 - 용병  (0) 2015.02.11
클래스 최종 실습 - 자판기  (0) 2015.01.10

+ Recent posts