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

59 thoughts on “Tasks and solution. С

  1. Help solve the problem in C ++ : “Known area circumscribed about an isosceles right triangle Circle. Write the algorithm for calculating the area of ​​a triangle and the triangle inscribed in it.

    1. #include
      #include
      using namespace std;
      float R;
      float a;
      float S;
      float r;
      float x;
      int main ()
      {
      x=sqrt (3);
      cout <> R;
      a=(R*3.0)/x;
      S=(a*a*x) /4;
      r=(a*x)/6;
      cout << "S=" << S << ";" << "r=" << r << ";" << "a=" << a << endl;
      return 0;
      }

    2. #include
      #include
      using namespace std;
      float R;
      float a;
      float S;
      float r;
      float x;
      int main ()
      {
      x=sqrt (3);
      cout <> R;
      a=(R*3.0)/x;
      S=(a*a*x) /4;
      r=(a*x)/6;
      cout << "S=" << S << ";" << "r=" << r << ";" << "a=" << a << endl;
      return 0;
      }

  2. Can someone do this?) Or at least give me a hint))
    Standard data types.
    Given an integer Y – year, lying in the range 1970–2100; integer M –
    month, lying in the range 1–12; integer D – current date, lying in
    range 1–31. Determine the number of seconds that have passed since 1 January 1970
    g. before the start of the specified date.

    1. #include

      using namespace std;

      int main ()
      {
      int YMax,YMin,D,M,S,H,Mi;
      YMin=1970;
      YMax=2100;
      M=12;
      D=31;
      H=60;
      Mi=60;
      S=60;
      S=(YMax-YMin)*M*D*H*Mi*S;
      cout<<S<<" seconds"<<endl;
      return 0;
      }

      1. Develop a library of functions to perform operations with binary
        wood. There should be a function of adding a tree node,
        removal unit, search and analysis of the need for balancing.

  3. help me please, 2 I've been sitting here racking my brain all day
    “The field of the chess board is determined by a pair of natural numbers, each of which is no more than 8: First number – vertical number (when counting from left to right), second – horizontal number (when counting from bottom to top). Given natural numbers a, b, c, d NO ​​more 8. On field a, b placed king, does it threaten field c, d.”

  4. Create a set from the number of students in your group. Display. Add students to a set of user choice and display again. The user must enter a last name to add. (The entered last name must not contain numbers or punctuation marks)
    Help to solve,I was sick on this topic.
    С

Leave a Reply

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