Look t this code plz:
#include <iostream>
using namespace std;
int main()
{
enum object {s,k,g};
object o,t;
cout << "Player One: "; cin >> o;
cout << "Player Two: "; cin >> t;
if (o==s && t==g) cout << "The Winner is Player One.
";
else if (o==k && t==s) cout << "The Winner is Player One.
";
else if (o==g && t==k) cout << "The Winner is Player One.
";
else if (o==g && t==s) cout << "The Winner is Player Two.
";
else if (o==s && t==k) cout << "The Winner is Player Two.
";
else if (o==k && t==g) cout << "The Winner is Player Two.
";
else cout << "No One is the Winner.
";
return 0;
}
while compiling I will get this error:no match for 'operator>>' in 'std::cin >> o
I'm using code-blocks. so what is wrong with this code?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…