Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- int main()
- {
- int* mas(NULL);
- int n(0);
- std::cout << "Enter your number of mas: " << std::endl;
- std::cin >> n;
- mas = new int[n];
- int count(0);
- for (int i = 0; i < n; i++)
- {
- int randvar = rand() - RAND_MAX/2;
- mas[i] = randvar;
- std::cout << mas[i] << std::endl;
- count = (mas[i]>3) ? (count+1) : count;
- }
- std::cout << "There are " << count << " of numbers, that bigger than 3" << std::endl;
- system("pause");
- delete[] mas;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement