Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- #include <ctime>
- using namespace std;
- void odin(){
- int n = 50;
- double a[50];
- for (int i = 0; i < n; i++) {
- a[i] = -30 + rand() % 60;
- cout << a[i] << " ";
- }
- cout << endl;
- double m = a[0];
- int spalilsya;
- for (int i = 0; i < n; i++)
- if (a[i] < m) {
- m = a[i];
- spalilsya = i;
- }
- for (int i = 0; i < n; i++)
- if (a[i] == m) {
- m = a[i];
- spalilsya = i;
- cout << m << " na " << i+1 << " meste"<<endl;
- }
- }
- void dva(double m, int n, int q) {
- srand(time(0));
- double *a = new double[n];
- for (int i = 0; i < n; i++) {
- a[i] = -q + rand()%(2*q) + m;
- cout << a[i] << " ";
- }
- cout << endl;
- }
- void tri(int m, int q) {
- srand(time(0));
- double **a = new double*[m];
- for (int i = 0; i < m; i++) {
- a[i] = new double[q];
- for (int j = 0; j < q; j++) {
- a[i][j] = 100 + rand() % 99;
- cout << a[i][j] << " ";
- }
- cout << endl;
- }
- cout << endl;
- }
- void chetire() {
- //ne ponyatno zadanie
- }
- void main() {
- tri(10, 10);
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement