Блог пользователя Fear_Is_An_Illusion

Автор Fear_Is_An_Illusion, 11 лет назад, По-английски
struct mewat1000
{
    string looks="";
}mewat1000;

int main()
{
string your_opinion;
cin >> your_opinion;
mewat1000.looks = your_opinion;

if(mewat1000.looks == "James Bond")
{
    Give++;

}
else
{
    Give--;

}
}
  • Проголосовать: нравится
  • -64
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
 
Проголосовать: нравится +17 Проголосовать: не нравится

No offense, but if you used that much of your brain in doing programming contests as you use for writing such stupid blogs, you would be much better off, and we'ld be spared from reading such crap.

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

That if statement, always goes to else section and Give++ would never execute. That's because after cin ing a string, there is no white spaces in that string, while your if statement has the condition some_string == "some string literal with white spaces".