Skip to content

Instantly share code, notes, and snippets.

@hisava
Created December 24, 2023 09:16
Show Gist options
  • Save hisava/2aac2a2e30f7a32ce5dfe029f6fa8920 to your computer and use it in GitHub Desktop.
Save hisava/2aac2a2e30f7a32ce5dfe029f6fa8920 to your computer and use it in GitHub Desktop.
mywhile.cpp
#include <iostream>
using namespace std;
int main() {
srand( time( NULL ) );
while ( true ) {
int randNum = rand() % 100 + 1;
cout << randNum << endl;
if ( randNum > 95 ) {
cout << "Конец цикла while" << endl;
break;
}
}
cout << "Пока. Хорошего дня" << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment