Skip to content

Instantly share code, notes, and snippets.

@Levii01
Created May 15, 2017 20:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Levii01/720124f4e2dcd83af9f8e00b50db3d1e to your computer and use it in GitHub Desktop.
Save Levii01/720124f4e2dcd83af9f8e00b50db3d1e to your computer and use it in GitHub Desktop.
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
using namespace std;
//int n, d, g, k;
int n=13, d=5, g=9, k=5;
void wprowadz_dane()
{
cout << "Podaj n:" << endl;
cin >> n;
cout << "Podaj przedzia¸ <d, g>";
cin >> d >> g;
cout << "przedzia¸ to <" << d << ", " << g << ">" << endl;
cout << "Podaj k:" << endl;
cin >> k;
}
int randomowe_liczby(){
return ((rand() % (g - d + 1)) + d);
}
int main()
{
//wprowadz_dane();
cout << n << d << g << k << endl;
int A[n];
//wprowadz_do_tablicy(tab);
for (int i=0;i<n;i++)
{
A[i] = randomowe_liczby();
}
for (int j=0;j<n;j++)
{
if((j+1)%k==0)
cout << "/n";
cout << A[j] << " ";
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment