Skip to content

Instantly share code, notes, and snippets.

View TheEvilRoot's full-sized avatar
💭
Achievement acquired: Find my github

TheEvilRoot TheEvilRoot

💭
Achievement acquired: Find my github
View GitHub Profile
.model small
.stack 100h
.data
str DB "Hello, World$", 0ah, 0dh
.code
f_divide PROC near
POP DX ; pop IP
POP AX ; (diviver)
POP BX ; (left)
PUSH DX ; push IP back
// Source: http://man7.org/linux/man-pages/man7/sigevent.7.html
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <aio.h>
#include <signal.h>
#include <conio.h>
#include <iostream>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;
const int len_matrix = 4;
#include <iostream>
#include <ctime>
void heap(int* arr, int heapSize, int node) {
int max = node;
int left = 2 * node + 1;
int right = 2 * node + 2;
if (left < heapSize && arr[left] > arr[max])
max = left;
#include <iostream>
int main() {
unsigned int height = 0;
std::cin >> height;
unsigned int width = height + height - 3;
if (height == 0)
return 0;
for (int i = 0; i < height - 1; i++) {
#include <iostream>
int main() {
setlocale(LC_ALL, "Russian");
unsigned int pointsCount = 0;
do {
std::cout << "Введите число точек: ";
std::cin >> pointsCount;
#include <iostream>
const int ROCK = 1;
const int PAPER = 3;
const int SCISSORS = 2;
int getUserMove(int playerIndex) {
int input;
do {
std::cout << "Выбор игрока " << playerIndex << ": ";
#include <iostream>
int isLeapYear(long year) {
if (year % 4 == 0) {
if (year % 100 == 0) {
if (year % 400 == 0) {
return true;
}
else {
return false;
#include <iostream>
int main() {
unsigned char c = 0;
do {
std::cout << c << " " << static_cast<unsigned int>(c) + 1 << std::endl;
} while (++c);
return 0;
}
#include <iostream>
#include <ctime>
#include <iomanip>
// Так как размер int, long и указателя для разных систем - различен
// Получаем их в константы
// sizeof(...) возвратит количество байт, нам нужно кол-во бит, поэтому
// умножаем на 8
#define intsize sizeof(int) * 8
#define ptrsize sizeof(void*) * 8