c++ goto循环

From , 5 Years ago, written in C++, viewed 86 times.
URL https://pastebin.vip/view/d7657583
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5.     using namespace std;
  6.     int counter = 0; // initialize counter
  7.  
  8. loop:
  9.     counter ++; // top of the loop
  10.     cout << "counter: " << counter << endl;
  11.     if (counter < 5) // test the value
  12.         goto loop; // jump to the top
  13.  
  14.     cout << "Complete. Counter: " << counter << endl;
  15.  
  16.     return 0;
  17. }
  18.  

Reply to "c++ goto循环"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website