上周我刚刚学会了如何使用 C++ 编程,并且我使用 Microsoft Visual Studios 2010 express 编写了我的第一个程序。我家里的电脑是 Mac,没有 MS Visual Studio,所以我决定使用 xcode 并将我的代码从 MS Visual Studio 复制到 xcode。大多数情况下没有任何错误,只是 xcode 的布尔逻辑语法有问题。以下是我的代码中存在问题的一些示例:
if(place == 1)
{
cout<< name << " 'IS NOW THE FASTEST JUNIOR IN THE UNITED STATES!!!\n";
cout<< "ABSOLUTLY INCREDIBLE!!!!! WHAT AN AMAZING RACE\n"
<< endl
<< endl;
cout<< "You did it! You won the race and are now the fastest Junior skier in the USA!\n";
cout<< "All that hard work really paid off for you!\n";
<<endl;
}
else (place >1)
{
cout << "You skied a great race, but unfortunately you did not beat Ben.\n";
cout<< "You can always race again next year and shoot for gold.\n"
<<endl;
}
出现的错误是“未使用表达式结果”。我该如何解决?