The basics of programming in c++ for beginners

Tasks and solution. С

  1. Data types, variables and constants
  2. Ввод с клавиатуры и вывод данных на экран
  3. Арифметические операции и комбинированные операторы
  4. Операторы выбора if и else в С
  5. The switch statement in C ++
  6. The for loop in C++
  7. Циклы while, do while, nested loops
  8. Two-dimensional arrays C ++
  9. Arrays in C++
  10. Functions in C++
  11. Pointers C ++
  12. A pointer to a pointer to C ++
  13. Classes in C ++

Additional collection of problems with solutions

практика программирования, задачи с решением, задачи по программированию с++, задачи по программированию C++

This page contains all of the tasks on the topics lessons, posted on our website. К каждой задаче прилагается наш вариант решения. Постарайтесь всё же решать их самостоятельно и только потом сравнивать наш исходный код со своим. “Хочешь научиться программировать – программируй”!

Больше практических заданий с решениями найдёте here.

Рекомендуем посетить Сайт для юных программистов – где вы найдете уроки по различным языкам программирования (в том числе для детей), 3D-моделированию, Linux и др.

Tasks and solution. С
4.6 (92.14%) 56 votes

43 thoughts on “Tasks and solution. С

  1. 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.

    1. 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)

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

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

  3. 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?”

  4. 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?

    1. #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;
      }

      1. 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.

  5. 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.

  6. 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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *