GithubHelp home page GithubHelp logo

whitehodok / algorithmexam Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.54 MB

Немного для подготовки к экзамену по ОКААСУ , поток АТП-221 , АТП-222 , УТС-221

C++ 100.00%
algorithms automation cpp

algorithmexam's Introduction

AlgorithmExam

ATTENTION

Если вы обладаете нулевыми знаниями по данной дисциплине , рекомендуемое время для освоения в курсе - НЕДЕЛЯ , за меньший срок можно не успеть.

C++ курс

Теория алгоритмов

Здесь я приложу замечательную книжку "Грокаем алгоритмы" Адитьи Бхаргвы , прочитав даже 100 страниц можно понять весь материал лекций за семестр , даже не напрягаясь :

Очень краткий конспект-шпаргалка для экзамена :

  • Алгоритмом называется набор инструкций для выполнения некоторой задачи.
  • Бинарный поиск и что это такое рассказывается на странице номер 20.

image

  • Что такое О(n) ? image

image

  • <О-большое>> определяет время выполнения в худшем случае . image

  • Задача о Коммивояжере на странице 37.

  • Сортировка выбором представлена на 40 странице.

  • Шпаргалка : image

image

image

image

image

image

Как работает память

image

image

image

image

Структура программы на языке C++

Зачем нужны заголовочные файлы

  • также тут отмечено чем отличается объявление функции от её определения image

image

image

Как подключить заголовочные файлы

image

Макросы и зачем они нужны

Как выглядит компиляция на языке C++

image

image

Переменные

В C++ существует несколько основных типов переменных. Вот некоторые из них с примерами вывода :

  • Целочисленные типы (Integer types):

image

int integer = 10;
std::cout << "Integer:" << integer << std::endl;

long long bigInteger = 123456789012345LL;
std::cout << "Big Integer: " << bigInteger << std::endl;
  • Вещественные типы (Floating-point types):
float floatingPoint = 3.14f;
std::cout << "Floating Point: " << floatingPoint << std::endl;

double doublePrecision = 2.71828;
std::cout << "Double Precision: " << doublePrecision << std::endl;
  • Символьный тип (Character type):
char character = 'A';
std::cout << "Character: " << character << std::endl;
  • Строковый тип (String type):
std::string string = "Hello, World!";
std::cout << "String: " << string << std::endl;
  • Логический тип (Boolean type):
bool boolean = true;
std::cout << "Boolean: " << std::boolalpha << boolean << std::endl;
  • Указатель (Pointer type):
int* pointer = nullptr;
std::cout << "Pointer: " << pointer << std::endl;
  • Массив (Array type):
int array[] = {1, 2, 3, 4, 5};
std::cout << "Array: ";
for (int i = 0; i < sizeof(array) / sizeof(int); ++i) {
    std::cout << array[i] << " ";
}
std::cout << std::endl;

Преобразование встроенных типов в операторах

Размеры типов данных

image

Ввод и вывод в консоли

Арифметические операции в C++

image

Code :

#include <iostream>

int main() {
    int a = 10;
    int b = 5;

    // Сложение
    int sum = a + b;
    std::cout << "Сумма: " << sum << std::endl;

    // Вычитание
    int difference = a - b;
    std::cout << "Разность: " << difference << std::endl;

    // Умножение
    int product = a * b;
    std::cout << "Произведение: " << product << std::endl;

    // Деление
    int quotient = a / b;
    std::cout << "Частное: " << quotient << std::endl;

    // Остаток от деления
    int remainder = a % b;
    std::cout << "Остаток от деления: " << remainder << std::endl;

    // Инкремент
    int c = 7;
    c++;
    std::cout << "Инкремент: " << c << std::endl;

    // Декремент
    int d = 3;
    d--;
    std::cout << "Декремент: " << d << std::endl;

    return 0;
}

Вывод в консоли:

Сумма: 15
Разность: 5
Произведение: 50
Частное: 2
Остаток от деления: 0
Инкремент: 8
Декремент: 2

Некоторые примеры неявных преобразований в коде :

Операции присваивания :

Тернарные операторы :

Циклы :

Ссылки и указатели :

Массивы :

Видево

Текст

Функции :

ООП :

Динамические массивы :

algorithmexam's People

Contributors

qubicool avatar whitehodok avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.