#include "stdafx.h"#include <iostream>#include <conio.h>using namespace std;int main(){ int a[10]; for (int i = 0; i < 10; i++) { cout << "a[" << i << "] = "; cin >> a[i]; } cout << "Source massiv: "; for (int i = 0; i < 10; i++) { cout << a[i] << " "; if (a[i] > 15) a[i] = 15; } cout << "\nNew massiv: "; for (int i = 0; i < 10; i++) cout << a[i] << " "; cout << endl; _getch(); return 0;}
#include "stdafx.h"
#include <iostream>
#include <conio.h>
using namespace std;
int main()
{
int a[10];
for (int i = 0; i < 10; i++)
{
cout << "a[" << i << "] = ";
cin >> a[i];
}
cout << "Source massiv: ";
for (int i = 0; i < 10; i++)
{
cout << a[i] << " ";
if (a[i] > 15)
a[i] = 15;
}
cout << "\nNew massiv: ";
for (int i = 0; i < 10; i++)
cout << a[i] << " ";
cout << endl;
_getch();
return 0;
}