0
나는 학습을위한 연습으로 간단한 계산기를 만들었고 나는 비틀어졌다 - 첫 번째 숫자에 대한 사용자 입력을 얻었지만 두 번째 입력에 대한 int를 저장하지 못함 - 개체를 만들어야합니까? ? 이것은 명백한 문제라고 생각합니다 ...C++의 간단한 계산기
//Simple calculator to work out the sum of two numbers (using addition)
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
cout << "Enter the first int: \n";
int input1 = std::cin.get();
cout << "Enter the second int: \n";
int input2 = std::cin.get();
cout << "The sum of these numbers is: " << input1 + input2;
cout << "\n";
system("PAUSE");
return EXIT_SUCCESS;
}
입력 번호는 어떻게 입력합니까? – Riskhan