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
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 тут? | |
} | |
} |
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
$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; | |
} | |
} |
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
'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; |
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
-- 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; |
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
#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') |
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
#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)); |
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
#define _CRT_SECURE_NO_WARNINGS | |
#include <stdio.h> | |
#include <locale.h> | |
#include <stdlib.h> | |
struct LocalItem { | |
int inf; | |
LocalItem *next; | |
}; |
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
#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; |
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
#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 { |
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
#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; | |
}; |
NewerOlder