Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include "math.h"
- #include "iostream"
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- float a, b, n;
- int massiv[100];
- setlocale(LC_ALL,"russian");
- cout<<"Введите число элементов массива"<<endl;
- cin>>n;
- cout<<endl;
- for (int j=0; j<n; j++)
- {
- if (n<100)
- {
- massiv[j] = rand()%10;
- cout<<massiv[j]<<endl;
- }
- }
- cout<<endl;
- cout<<"Введите элемент массива А"<<endl;
- cin>>a;
- cout<<"Введите элемент массива В"<<endl;
- cin>>b;
- cout<<endl;
- cout<<"Элементы массива"<<endl;
- for (int i=a; i<b; i++)
- {
- cout<<massiv[i]<<endl;
- }
- cout<<endl;
- cout<<"Этап второй:"<<endl;
- system("pause");
- return 0;
- }
Add Comment
Please, Sign In to add comment