A C++ version of the branch option game based on the novel Three-Body Problem (modified version)

For example, I recently became fascinated with the novel “Three-Body Problem”, so I made such a simple little game in a daze. Of course, for the great gods who have learned C++, they can know the branch result without running it. . . . .

# include  <iostream>
 using  namespace  std ;
 int  main ()
 {
     int ichoice;
     cout << "Welcome to the mini game!\n" ;
     cout << "Please enter 0 (for agree) or 1 (for negative) to choose Branch, your choice is related to the fate of the earth!\n" ;
     cout << "Ye Wenjie will send a signal through the sun, do you want to stop it?" ;
     cin >>ichoice;
     if (ichoice== 0 ) cout << "The signal is not Send, Trisolaran has not found Earth civilization, successfully defending the Earth! Happy end" ;
     else  cout << "Signal sent, Trisolaran found Earth, Earth is in danger!\n";
    coutEarthlings detonated Mercury, a chain reaction occurred, and the solar system was swallowed by the sun! . Dead end" ;
      return 0;

}

Of course, the codewords conceived are all made by yourself, and the weight of the code is all on it. . . . . .

Teacher He said that the code should be indented, but this is the effect of indenting with codeblock. . . . After thinking about it, I still rely too much on the software. I just use the source code formatter, which is very inconsistent with the textbook, so I modified it myself.

# include  <iostream>
 using  namespace  std ;
 int  main ()
 {
     int ichoice;
     cout << "Welcome to the mini game!\n" ;
     cout << "Please enter 0 (for agree) or 1 (for negative) to choose Branch, your choice is related to the fate of the earth!\n" ;
     cout << "Ye Wenjie will send a signal through the sun, do you want to stop it?" ;
     cin >>ichoice;
     if (ichoice== 0 ) cout << "The signal is not Send, Trisolaran has not found Earth civilization, successfully defending the Earth! Happy end" ;
        else  cout << "Signal sent, Trisolaran found Earth, Earth is in danger!\n";
            coutEarthlings detonated Mercury, a chain reaction occurred, and the solar system was swallowed by the sun! . Dead end"  ;
    return 0;

}

Leave a Comment

Your email address will not be published. Required fields are marked *