コンパイル時にエラーはありません...しかし、出力には何も得られません。私はこれがコーディングにおける非常に初歩的な試みであることを知っています.私は主に数字を扱ってきました.
#include <iostream>
#include <string>
using namespace std;
char chr;
int main()
{
string name;
string artist;
string Taylor;
string Alan;
string general;
string box;
string seating;
cout << "Enter your name followed by the return key" << endl;
cin >> name;
cout << endl;
cout << "Enter Taylor for Taylor Swift tickets or Alan for Alan Jacskon seats, followed" << endl << "by the enter key" << endl << endl;
cout << "Enter box for box seating or general for general seating, followed by the enter key" << endl << endl;
cin >> artist;
cin >> seating;
if ( artist + seating == Taylor + general )
cout << name << ", Your ticket will cost $60" << endl;
else if ( artist + seating == Taylor + box )
cout << name << ", Your ticket will cost $100" << endl;
else if ( artist + seating == Alan + box )
cout << name << ", Your ticket will cost $75" << endl;
else if ( artist + seating == Alan + general )
cout << name << ", Your ticket will cost $50" << endl;
cin >> chr;
return 0;
}