저는 C++을 처음 접했습니다. 이것은 내가 현재 폐기하고있는 것이므로, 프로그램에 적용하려고하는 논리를 추측 할 수 있다고 가정합니다. 나는 사용자가 수행 할 산술을 제공해야하며 숫자를 함께 추가하는 것이 확실하다면 필요하다. 여기 코드는 다음과 같습니다 13 오류 :기본 C++ 계산기
#include <iostream>
#include <string>
using namespace std;
int main()
{
int x;
int v;
int sum;
string input;
cout << "Choose arithmetic: addition or subtraction? " << endl;
cin >> input;
if(input=='Addition'||input=='addition')
{
int first;
int second;
int sum = first+second;
cout << "Enter the first number: " << endl;
cout << "Enter the second number: " << endl;
cout << "The sum of these numbers is: " << sum << endl;
}
return 0;
}
컴파일러는 나에게 다음과 같은 오류를 제공하지 일치를 '연산자 =='에 대한 '입력 == 1953066862'에
사전에 감사를!
거기에있는 다른 코드와 오류가 참조하는 행에 따라 차이점을 발견 할 수 있어야합니다. – chris