This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
setlocale(LC_ALL, "Russian"); | |
unsigned int pointsCount = 0; | |
do { | |
std::cout << "Введите число точек: "; | |
std::cin >> pointsCount; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
const int ROCK = 1; | |
const int PAPER = 3; | |
const int SCISSORS = 2; | |
int getUserMove(int playerIndex) { | |
int input; | |
do { | |
std::cout << "Выбор игрока " << playerIndex << ": "; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int isLeapYear(long year) { | |
if (year % 4 == 0) { | |
if (year % 100 == 0) { | |
if (year % 400 == 0) { | |
return true; | |
} | |
else { | |
return false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
unsigned char c = 0; | |
do { | |
std::cout << c << " " << static_cast<unsigned int>(c) + 1 << std::endl; | |
} while (++c); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ctime> | |
#include <iomanip> | |
// Так как размер int, long и указателя для разных систем - различен | |
// Получаем их в константы | |
// sizeof(...) возвратит количество байт, нам нужно кол-во бит, поэтому | |
// умножаем на 8 | |
#define intsize sizeof(int) * 8 | |
#define ptrsize sizeof(void*) * 8 |
NewerOlder