Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // lab10z2.cpp: определяет точку входа для консольного приложения.
- //
- #include "stdafx.h"
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int C, arr[10], *arrp = &arr[10];
- void fill ()
- {
- int i;
- cout << "Enter the numbers of array" << '\n';
- for (i=0; i<10; i++)
- {
- cout << "arr[" << i << "] = ";
- cin >> *(arrp+i);
- }
- }
- void count ()
- {
- int i;
- for ( i=0; i < 10 ; i++)
- {
- if (*(arrp+i)>8)
- {
- C++;
- }
- }
- }
- void sorting ()
- {
- std::sort(arrp, arrp+10);
- }
- int main ()
- {
- fill();
- count();
- sorting();
- cout << '\n' << "The results of Sorting";
- int i;
- for (i=0; i<10; i++)
- {
- cout << '\n' << "arr[" << i << "] = " << *(arrp + i);
- }
- cout << '\n' << '\n' << "Amount of numbers more than 8 = " << C << '\n';
- }
Advertisement
Add Comment
Please, Sign In to add comment