-
-
Save Levii01/720124f4e2dcd83af9f8e00b50db3d1e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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