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
void main(){ | |
int a=5; | |
int b=3; | |
a ^= b; | |
b ^= a; | |
a ^= b; | |
print(@"$a, $b"); | |
} |
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
public enum BinSide{ | |
Left, | |
Right | |
} | |
public class BinaryTree{ | |
public long? Data { get; private set; } | |
public BinaryTree Left { get; set; } | |
public BinaryTree Right { get; set; } | |
public BinaryTree Parent { get; set; } |
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
void main(string[] args) { | |
int[] e = {}; | |
for (int i=0,j=0;i<100;i++,j++) { | |
e+=j;e+=j;//заполнение парными | |
} | |
e+=100003;//уникальный | |
ulong micsec; | |
double sec; |
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 <stdint.h> | |
#include <stdalign.h> | |
#include <immintrin.h> | |
#include <math.h> | |
#include <stdio.h> | |
// intptr_t should be the native integer type on most sane systems. | |
typedef intptr_t intnative_t; | |
typedef struct{ |
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
/* The Computer Language Benchmarks Game | |
https://salsa.debian.org/benchmarksgame-team/benchmarksgame/ | |
contributed by Isaac Gouy | |
*/ | |
// using System; | |
[Compact] | |
class NBody { | |
public static void main(string[] args) { |
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
using Gtk; | |
public class MainWindow : Gtk.Window | |
{ | |
private Box vboxMain; | |
private ScrolledWindow swFiles; | |
private TreeView tvFiles; | |
private TreeViewColumn colName; | |
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 func (int k, int n){ | |
return k<<n; | |
} | |
void main(string[] args) { | |
print(@"$(func(3,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
string exponentiation(string str, int n){ | |
string result=""; | |
for (int i=0;i<n;i++) result+=str; | |
return result; | |
} | |
string take_root(string str, int n){ | |
int temp = (str+str)[0:-1].index_of(str,1); | |
if(temp != -1 && (str.char_count()>=str[0:temp].char_count()*n)){ | |
return exponentiation (str[0:temp],str.char_count()/temp /n); |
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
void main(string[] args) { | |
int[,] d = {{0, 1}, | |
{1, 0}}; | |
int c=0; | |
foreach (var a in d) | |
if(a==1) c++; | |
print(@"Roads: $(c/2)"); | |
} |
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
using Gee; | |
void fill_col(ref int[,] arr,int a){ | |
for (int i = 0; i < arr.length[0]; i++) { | |
arr[i,a]=0; | |
} | |
} | |
void fill_row(ref int[,] arr,int a){ | |
for (int i = 0; i < arr.length[1]; i++) { |