Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Begin5_2 (1).docx
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
1.06 Mб
Скачать

Int main()

{

char c=122;

int a,b;

cin>>a;

for(b=0;b<a;b++,c--)

cout<<c<<endl;

system("pause");

return 0;

}

15)

a)

#include<iostream>

using namespace std;

Int main()

{

for(double a=21,b=19.2;a > 9;)

std::cout << a-- << ' ' << b-- << std::endl;

system("pause");

return 0;

}

b)

#include<iostream>

using namespace std;

Int main()

{

for(double a = 45,b = 44.5,c = 44.2;a > 24;)

std::cout << a-- << ' ' << b-- << ' ' << c-- << ' ' << std::endl;

system("pause");

return 0;

}

16)

#include <iostream>

#include <cstdlib>

#include <iomanip>

#include <ctime>

using namespace std;

Int main()

{

setlocale(0, "rus");

const int size = 5;

srand((unsigned)time(NULL));

int matrix[size][size];

int i, j;

int s, k;

for ( i = 0; i < size; i++)

for ( j = 0; j < size; j++)

matrix[i][j] = rand() % 100;

for ( i = 0; i < size; i++)

for ( j = 0; j < size; j++)

{

if(j % size == 0)

cout << endl;

cout << setw(3) << matrix[i][j];

}

cout << endl << endl;

cout << "Элементы 5 строки " << endl;

for ( j = 0; j < size; j++)

cout << matrix[4][j] << " ";

cout << endl;

cout << "Введите s ( 1 - 5) " << endl;

cin >> s;

cout << "Элементы s столбца " << endl;

for ( i = 0; i < size; i++)

cout << matrix[i][s-1] << " ";

cout << endl;

system("Pause");

}

17)

#include<iostream>

using namespace std;

Int main()

{

float a,b,c;

a=1;

b=13;

c=49;

cout<<a<<" " <<b<<" "<<c<<endl;

system("pause");

return 0;

}

18)

#include <iostream>

using namespace std;

Int main()

{

int i=100;

for(i=100;i<1000;i++)

if(i%47==43 || i%43==47)

{ cout<<i<<endl;}

system("pause");

return 0;

}

19)

#include <iostream>

#include <cmath>

using namespace std;

Int main ()

{

const double PI = 3.141593;

int n,i;

double* s = NULL;

cout << "Vvedite kolichestvo krugov n = ";

cin >> n;

s = new double [n];

for (int i = 0; i < n; ++i)

{

cout << "Vvedite ploschad\' kruga S" << i+1 << " = ";

cin >> s[i];

}

double min = s[0];

int x = 0;

for (i = 0; i < n; ++i)

{

if (min > s[i])

{

min = s[i];

x = i;

}

}

double r = sqrt ((double)(min/PI));

cout << "Ploschad\' kruga R" << x+1 << " = " << r << "\n";

free (s);

system("pause");

return 0;

}

20)

#include <iostream>

#include <math.h>

using namespace std;

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]