- Data types, variables and constants
- Ввод с клавиатуры и вывод данных на экран
- Арифметические операции и комбинированные операторы
- Операторы выбора if и else в С
- The switch statement in C ++
- The for loop in C++
- Циклы while, do while, nested loops
- Two-dimensional arrays C ++
- Arrays in C++
- Functions in C++
- Pointers C ++
- A pointer to a pointer to C ++
- Classes in C ++
Additional collection of problems with solutions
This page contains all of the tasks on the topics lessons, posted on our website. К каждой задаче прилагается наш вариант решения. Постарайтесь всё же решать их самостоятельно и только потом сравнивать наш исходный код со своим. “Хочешь научиться программировать – программируй”!
Больше практических заданий с решениями найдёте here.
Рекомендуем посетить Сайт для юных программистов – где вы найдете уроки по различным языкам программирования (в том числе для детей), 3D-моделированию, Linux и др.
Write a program in C ++, to calculate the values of the variables y and z according to the given formulas. Use scanf function for input, for withdrawal- printf function. Determine the difference in values between y and z (y-z).
y = cos(a)+without(a)/cos(a)-without(a)
z = tan(2a)+sec(2a)
#include
#include
#define PI 3.14159265
int main()
{
//char str[80];
define PI, from, Y, b;
printf (“define PI “);
scanf_s(“%f”, &a);
define PI(a * PI / 180.0)+without(a * PI / 180)/ cos(a * PI / 180.0)- without(a * PI / 180);
define PI(2 * a * PI / 180.0) + 1 / cos(2 * a * PI / 180.0);
define PI – from;
define PI(” %[object Window]”, Y, from, b);
}
help me please!!
Triangle class
properties: Triangle class
Triangle class:
Triangle class (Triangle class) Triangle class;
About calculating the length of the bisector belonging to any angle;
About calculating the length of the bisector belonging to any angle, About calculating the length of the bisector belonging to any angle;
About calculating the length of the bisector belonging to any angle.
Write a program in C ++
An array of real numbers is specified. Determine the number of the largest element of this array and delete it, moving all the elements to the left by one position, located at the maximum. Print an abbreviated array.
#include
using namespace std;
int main () {
int i,j,n,a[1000],b[1000];
int maxim=0,z=0,num=1;
cout <> n;
cout << endl;
for (i=0; i<n; i ) {
cout << on one <> a[i];
num++;
}
while (from!=i) {
maxim=0;
for (j=0; jmaximum)
maxim=a[j];
}
for (j=0; j<i; j ) {
if (a[j]==maxim)
a[j]=0;
}
b[from]=maxim; with ++;
}
cout << endl;
for (j=0; j<from; j ) {
cout << " " << b[j];
}
return 0;
}
Write a program in C ++
Enter an array of real numbers from the keyboard (maximum dimension - 25 elements). Enter the numbers of those elements entered in the new integer array, which exceed the average value of all its elements by two or more times. Print the generated array or display a message about the absence of such elements.
#include
using namespace std;
int main() {
system(“chcp 65001”);
int arr1[25], arr2[25];
cout <> x;
cout << "Input numbers array" << endl;
for (int i = 0; i > arr1[i];
average += arr1[i];
}
average /= x;
int j = 0, checkNumbers = 0, average1 = average * 2;
for (int i = 0; i < x; i ) {
if (average1 < arr1[i]) {
arr2[j] = arr1[i];
j ;
checkNumbers++;
}
}
if (checkNumbers == 0) {
cout << "These elements no found";
}
else {
cout << "Out array = ";
for (int i = 0; i < j; i ) {
cout << arr2[i] << " ";
}
}
return 0;
}
help me please, very urgently needed
In the two-dimensional array (N+15)x(N+15) sort each pair
descending column. Generate random numbers in the interval [-N-15;
N+15].
given an array of real numbers of dimension n. If the array is ordered in ascending or non-increasing order to leave it unchanged. 4 keeping the order of the other members. I will be grateful
given an array of real numbers of dimension n. If the array is ordered in ascending or non-increasing order to leave it unchanged. 4 maintaining the order of the other members. I will be grateful for C ++
Identify, in which half of the array is the maximum element of the array,
provided that he is the only one.
Describe the functions of keyboard entry of elements of a one-dimensional mass-
Describe the functions of keyboard entry of elements of a one-dimensional mass 2
elements: Describe the functions of keyboard entry of elements of a one-dimensional mass 0, Describe the functions of keyboard entry of elements of a one-dimensional mass
Describe the functions of keyboard entry of elements of a one-dimensional mass.