- 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 и др.

lovely Elephants

prb4715 In one Indian village teacher asked the boy Manmohan count the number of elephants in the village. Manmohan counted all the elephants in the village, and he got a two-digit number n. But instead of, to report the answer to the teacher, Manmohan has decided to play a trick bit. For this Manmohan subtracted from the resulting sum the number of its digits, I divide the result by 9 (rejecting at the same fractional part of the result), that number increased to 1, then append to the end of the last digit obtained starting from the result subtracted chislani 10. Then, what happened in the end, he told the teacher.

Despite all the cunning Manmohan, teacher could determine the number of resulting, how many elephants were in the village. Identify it and you.

Input data

Целое число, which received Manmohan.

Output

Print the number of elephants in the village.

Thank you, for homework. I worked the brain) The decision take off below:

// The solution of the problem

manhomannumb + = 10;

b = manhomannumb %10;

teachernumb = manhomannumb;

teachernumb /= 10;

teachernumb –;

teachernumb *= 9;

while (teachernumb % 10 != 0) teachernumb++;

teachernumb += b;

cout << "Учитель посчитал. Elephant Village: "<< teachernumb << endl;

system("pause");

return 0;

}

Thanks again)

I know how ispolzevat but I need examples please answer!

Learn to write, Guliza, and then for the mother let the computer.

help me please “Classes begin in n hours m minutes,and ends at a clock k hvydyn.Skilky hours and minutes long zahyattya

Move all in minutes, Vienna, and then find a result from Dillen – years, the balance – moments

You can help very urgently needed “In the beauty salon come girls n. Each of them should visit the hairdresser and beautician. Everyone she spends hours on m. During that time the smallest k salon staff will serve all girls, If each employee can serve as a cosmetologist, and the hairdresser?”

Help please Proteins saryatali in the hollow N nuts. Every day they took half for yourself and your friends. If the number of nuts was odd that they put off a nut in the direction and the other half dilili,wherein the nut deferred again returned into the hollow. Write a program, podschitvayuschuyu,many nuts remain in the bag by K days?

#include

using namespace std;

int main()

{

int N, K;

cin >> N >> K;

for(K; K>0; K–){

if(N%2==1 and N!=1) N=(N/2)+1;

presence of N = N / 2;

}

cout << N;

}

help me please: write program code to solve the problem. The triangle vertex coordinates set A (0;0), At (and, and 1), Exist (-and, i + 1), and = 9. Calculate the height Ha of the inscribed circle and the radius r.

help me please: write program code to solve the problem. Triangle asked the coordinates of the vertices A (0;0), At (and, and 1), Exist (-and, and +1), and 9 =. Calculate the height Ha and inscribed circle radius r.

help me please: write program code to solve the problem. The triangle vertex coordinates set A (0;0), At (and, and 1), Exist (-and, i + 1), and = 9. Calculate the height Ha of the inscribed circle and the radius r.

Perform all tasks of a theoretical part and debug the reduced program

Perform all tasks of a theoretical part and debug the reduced program