Skip to content

Instantly share code, notes, and snippets.

View gavr123456789's full-sized avatar
🪂

gavr gavr123456789

🪂
View GitHub Profile
void main(){
int a=5;
int b=3;
a ^= b;
b ^= a;
a ^= b;
print(@"$a, $b");
}
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; }
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;
#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{
/* 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) {
using Gtk;
public class MainWindow : Gtk.Window
{
private Box vboxMain;
private ScrolledWindow swFiles;
private TreeView tvFiles;
private TreeViewColumn colName;
int func (int k, int n){
return k<<n;
}
void main(string[] args) {
print(@"$(func(3,4))");
}
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);
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)");
}
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++) {