Skip to content

Instantly share code, notes, and snippets.

@KrystianGraba
Created April 29, 2020 11:57
Show Gist options
  • Select an option

  • Save KrystianGraba/e214dbc19e75b36c51abeca13c0cd0be to your computer and use it in GitHub Desktop.

Select an option

Save KrystianGraba/e214dbc19e75b36c51abeca13c0cd0be to your computer and use it in GitHub Desktop.
#include <iostream>
#include <time.h>
#include <stdlib.h>
using namespace std;
int main()
{
int ile_liczb;
cout << "Ile liczb z przedziału 1-100 wylosowac: ";
cin >> ile_liczb;
//losowanie
int los;
srand(time(NULL));
for (int i = 0; i < ile_liczb;i++) {
cout << "Liczba nr " << i+1 << " to: " << (rand() % 100 + 1) << endl;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment