#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;
}
using namespace std;
int main()
{
for(int i = 3; i <=100;i++)
if (i %(mod в Паскале) 2 == 0) cout << i << " ";
}
//2
#include <iostream>
using namespace std;
int main()
{
int arr[10];
for(int i = 0; i < 10; i++)
{
cin >> arr[i];
if (arr[i] > 15) arr[i] = 15;
}
for(int i = 0; i < 10; i++) cout << arr[i] << " ";
}