Skip to content

Instantly share code, notes, and snippets.

View DieTime's full-sized avatar
Working from home

Denis Glazkov DieTime

Working from home
View GitHub Profile
@DieTime
DieTime / Popular sorting.cpp
Last active May 9, 2019 08:52
Types of sorting: Shell, Inserts and Bubble
@DieTime
DieTime / RK.c
Last active December 15, 2019 15:20
#pragma warning(disable:4996)
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <string.h>
struct Student {
char surname[32];
char group[32];
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
// Подсчет размера строки
int strlen(char* a) {
int i = 0;
while (a[i] != '\0') {
i++;
}
#include <stdio.h>
#include <stdlib.h>
#include <locale.h>
#include <ctype.h>
// Функция сравнения строк
int mystrcmp(char* s1, char* s2) {
int i = 0;
// пока одна из строк не закончится сравниваем символы
while (s1[i] != '\0' && s2[i] != '\0')
@DieTime
DieTime / lesson1.ipynb
Created January 8, 2020 18:42
Урок СИ #1
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DieTime
DieTime / lesson2.ipynb
Created January 8, 2020 18:43
Урок СИ #2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
float cx = (x + x2 + x3) / 3;
float cy = (y + y2 + y3) / 3;
float l1 = std::sqrt((x - cx) * (x - cx) + (y - cy) * (y - cy));
float l2 = std::sqrt((x2 - cx) * (x2 - cx) + (y2 - cy) * (y2 - cy));
float l3 = std::sqrt((x3 - cx) * (x3 - cx) + (y2 - cy) * (y2 - cy));
float dx = 2 * (x - cx) / l1 * (width / (float)glutGet(GLUT_WINDOW_WIDTH));
float dy = 2 * (y - cy) / l1 * (width / (float)glutGet(GLUT_WINDOW_HEIGHT));
float dx2 = 2 * (x2 - cx) / l2 * (width / (float)glutGet(GLUT_WINDOW_WIDTH));
float dy2 = 2 * (y2 - cy) / l2 * (width / (float)glutGet(GLUT_WINDOW_HEIGHT));
float dx3 = 2 * (x3 - cx) / l3 * (width / (float)glutGet(GLUT_WINDOW_WIDTH));
@DieTime
DieTime / М3О-208Б-18 Глазков ЧМ Задания из методички.ipynb
Last active May 24, 2020 08:31
Решение задач из методички по численным методам
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@DieTime
DieTime / Queue.cpp
Last active May 28, 2020 06:45
Queue with insert ascending
#include <iostream>
#include <cassert>
using namespace std;
// Элемент очереди
class Node {
public:
int value; // Значение
Node *last; // Предыдущий элемент
@DieTime
DieTime / rootwords.cpp
Created May 28, 2020 19:35
Finding root words in file
/* Отключение предупреждений Visual Studio при
использовании "небезопасных" функций (strtok) */
#pragma warning(disable : 4996)
#include <iostream>
#include <fstream>
#include <string>
#include <locale>
#include <windows.h>