Skip to content

Instantly share code, notes, and snippets.

View romec512's full-sized avatar
💭
working on my project

romec512

💭
working on my project
  • Kazan
View GitHub Profile
int [] mass = {10, 2, 3, 3, 4, 1, 1, 1, 2, 6};
int [] quantity = {1, 2, 3, 4, 5};
int [] results = {0, 0, 0, 0, 0};
for (int i = 0; i < mass.length; i++) {
for (int j = 0; j < quantity.length; j++) {
if (mass[i] == quantity[j]) {
results[j]++;
break; //Зачем break тут?
}
}
@romec512
romec512 / index.php
Created June 7, 2019 16:59
тестовое задание
$array = array(1, 0, 6, 9, 4, 5, 2, 3, 8, 7);
for ($j = 0; $j < count($array) - 1; $j++){
for ($i = 0; $i < count($array) - $j - 1; $i++){
if ($array[$i] > $array[$i + 1]){
$tmp_var = $array[$i + 1];
$array[$i + 1] = $array[$i];
$array[$i] = $tmp_var;
}
}
@romec512
romec512 / make-multi-filter.js
Last active March 3, 2019 12:15
Первая лаба по web
'use strict';
function getCurrentArray(originalArray, filterCriteria) {
var currentArray = [];
for(var i = 0; i < originalArray.length; i++){
if(filterCriteria(originalArray[i])){
currentArray.push(originalArray[i]);
}
}
return currentArray;
@romec512
romec512 / Lab2 bd
Created November 16, 2018 05:42
скрипты бд второй лабы
-- EXEC sp_helpdb testdb;
-- CREATE DATABASE snapshot_db ON ( NAME = N'testdb',
-- FILENAME= N'/Users/roman/workspace/labdb/spashot_db.ss'
-- ),
-- (NAME = N'testdb1',
-- FILENAME= N'/Users/roman/workspace/labdb/spashot_db_2.ss')
-- AS SNAPSHOT OF testdb;
-- SELECT * FROM testdb.dbo.table1;
@romec512
romec512 / Lab16.cpp
Created June 8, 2018 15:20
Lab16,17,18
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <string.h>
int hash(char *word)
{
int i = 0, sum = 0;
while (word[i] != '\0')
@romec512
romec512 / Lab14.cpp
Created May 29, 2018 10:09
Lab13, Lab14, Lab15
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <math.h>
void RandomShuffle(int *a, int n)//перемешивание массива
{
srand(time(NULL));
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
struct LocalItem {
int inf;
LocalItem *next;
};
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
const int N = 10;
struct List
{
int mass[N];
int count;
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
#include <time.h>
struct QueueEl {
int data;
QueueEl* next;
};
struct Queue {
@romec512
romec512 / Lab2
Created April 1, 2018 18:38
Laba2
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>
struct Queue {
int data[3];
int first;
int last;
int count;
};