This file contains 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
10 4 3 10 2 | |
call #1. Base: 5 | |
1: ^10 4 3 10 2$ | |
swap | |
2: ^2 4 3 10 10$ | |
3: 2 ^4 3 10 10$ | |
4: 2 4 ^3 10 10$ | |
5: 2 4 3 ^10 10$ | |
6: 2 4 3 ^10$ 10 |
This file contains 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 <iomanip> | |
#include <cmath> | |
using namespace std; | |
void printHelix(int * matrix[], int size) | |
{ | |
int x = size / 2; | |
int y = x; |
This file contains 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
const | |
size = 30; | |
multiplier = 31; { Для генератора псевдослучайных чисел } | |
module = 37; | |
{********** Array Counter Object ***********} | |
type arrayType = array[1..size] of integer; |
This file contains 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
program IsPermutation; | |
type IntArray = array[1..1024] of integer; | |
function isPermutation(a: IntArray; size: integer): boolean; | |
var i, mark: integer; | |
begin | |
i := 1; | |
IsPermutation := true; { Цикл работает до первого нарушения структуры перестановки } | |
while (IsPermutation = true) and (i <= size) do begin |
This file contains 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
program NewtonSearchRoot; | |
type | |
FunctionType = function(x: double): double; | |
const | |
maxSteps = 100; { Максимально допустимое количество шагов } | |
eps = 0.000000000001; { Требуемая точность вычислений } | |
printInterRes = false; { Печатать ли все промежуточные приближения } |
This file contains 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 <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
union Date | |
{ | |
struct | |
{ | |
char year[5]; | |
char mounth[3]; |
This file contains 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
type | |
ArrayType = array[1..7] of integer; | |
procedure findCicles(a: ArrayType; var dst: ArrayType); | |
var | |
startOfCicle: integer; | |
globalPointer: integer; | |
localPointer: integer; | |
address: integer; | |
i: integer; |
This file contains 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 <fstream> | |
#include <iostream> | |
using namespace std; | |
/** | |
* Главная идея: Если множество чисел второго массива лежит во множестве | |
* чисел первого и данные множества равномощны, то они равны. | |
*/ | |
int main() | |
{ |
This file contains 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
// author: Roman Tereshin | |
// email: roman.tereshin@student.spbu.ru | |
// hw 06, task 02 | |
// По дереву разбора арифметического выражения вычислить его значение. Дерево разбора хранится в файле в виде | |
// (<операция> <операнд1> <операнд2>), где <операнд1> и <операнд2> сами могут быть деревьями, либо числами. | |
// Например, выражение (1 + 1) * 2 представляется в виде (* (+ 1 1) 2). Должны поддерживаться операции +, -, *, / | |
// и целые числа в качестве аргументов. Требуется построить дерево в явном виде, распечатать его (не обязательно так | |
// же, как в файле), и посчитать значение выражения обходом дерева. Может быть полезна функция ungetc (если не '(', |
This file contains 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
procedure StraightMergeSort; | |
var | |
i,j,k,L,t,h,m,p,q,r: | |
integer; | |
bUp: | |
boolean; | |
begin | |
nMove:=0; | |
nCompare:=0; |