- 1
- 2
- 3
- 4
- 5
- 6
let inline id a = a
let inline const1 value _ = value
let inline applyNTimes f n s =
let fs = Seq.init n <| const1 f
let fa = Seq.fold (>>) id fs
fa s
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+127
let inline id a = a
let inline const1 value _ = value
let inline applyNTimes f n s =
let fs = Seq.init n <| const1 f
let fa = Seq.fold (>>) id fs
fa s
+127
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace Slogan
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Выбрать текст из файла (1). Написать самому (2).");
char ch = Convert.ToChar(Console.ReadLine());
if (ch == '2')
{
Console.WriteLine("Количество слов");
int x = Convert.ToInt32(Console.ReadLine());
string[] arr = new string[x];
Console.WriteLine("Вводите слова");
for (int i = 0; i < arr.Length; i++)
{
arr[i] = Console.ReadLine();
}
int count = 0;
string slogan = "";
do
{
slogan = "";
for (int i = 0; i < arr.Length; i++)
{
System.Threading.Thread.Sleep(20);
Random rnd = new Random();
int fr = rnd.Next(0, x);
slogan += arr[fr] + " ";
}
Console.WriteLine(slogan);
count++;
} while (count != arr.Length);
}
else if (ch == '1')
{
string slogan = "";
Console.WriteLine("Введите имя пользователя Windows");
string user = Console.ReadLine();
Console.WriteLine("Введите название файла на рабочем столе");
string way = Console.ReadLine();
try
{
string input = File.ReadAllText("c:/users/" + user + "/desktop/" + way);
Console.WriteLine("Введите название файла на рабочем столе, куда сохранять");
string waytosave = "c:/users/" + user + "/desktop/" + Console.ReadLine();
string[] split = input.Split(new Char[] { ' ', ',', '.', ':', '\t' });
int counter = 0;
do
{
slogan = "";
for (int i = 0; i < split.Length; i++)
{
System.Threading.Thread.Sleep(20);
Random rnd = new Random();
int fr = rnd.Next(0, split.Length);
slogan += split[fr] + " ";
}
Console.WriteLine(slogan);
File.AppendAllText(waytosave, slogan);
counter++;
} while (counter != split.Length);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
Console.ReadLine();
}
}
}
Выводит получаемые слова случайным образом
+127
#define PIXEL_PARTS_NUM 3
typedef struct _pixel {
char parts[PIXEL_PARTS_NUM];
} pixel;
+127
https://www.peereboom.us/assl/assl/html/openssl.html
+127
BFAAAACOAADODBFACACGOAAOCCBDBFADCCBAACODBFADCAOAACOBGEDOCCCGAACDACCCGCCBDEEBEAAOEBBFBGFAACBADBADBGOAACBBDBBDCGEABEDBFAEBCOAAABAAOCOCAEOADADBFACACBBAAECBBBCFBCBAOAAGOBGODBODAD
Игра для ДОС в машинных кодах на системе счисления wct. (программа - http://yadi.sk/d/i9Me1IQ7MbHCD wct editor). http://wctsite.tk.
+127
http://ic.pics.livejournal.com/sharpc/9812774/55307/55307_original.png
Я вот думал, а не запостить ли в раздел PHP...
+127
unfoldr (\b -> fmap (const . (second $ drop 1) . break (==' ') $ b) . listToMaybe $ b)
+127
import Data.List
import Data.Maybe
checkBraces "" = True
checkBraces e = checkBrace e [] where
openBraces = "({["
closeBraces = ")}]"
braceToBrace fromBraces toBraces brace = toBraces!!(fromJust $ elemIndex brace fromBraces)
otcBrace = braceToBrace openBraces closeBraces
checkBrace (c:e) s | elem c openBraces = checkBrace e ((otcBrace c):s)
checkBrace (c:e) (h:s) | (elem c closeBraces) && (h==c) = checkBrace e s
checkBrace (_:e) _ = False
checkBrace [] [] = True
checkBrace [] _ = False
main = mapM_ (print . checkBraces) bracesExpressionExamples where
bracesExpressionExamples =
[
"({[{}]{}[]})",
"({}}{[{}]{}[]})",
"({[{}]{}[]}",
"({[{}]{}]})",
"({[{}{}[]})",
"",
"{}"
]
http://ideone.com/sZ9tiN
Кот с собеседований.
Проверка правильности расстановки скобок для каждого выражения из bracesExpressionExamples.
+127
#define SOME_MACRO_NAME 4 /* 1 */
+127
Переустановил я, значит, Шиндоус 7 (лицуха), ставлю VS 2012
Все встало без проблем, предупреждений и криков о помощи.
При запуске ВНЕЗАПНО всплыло окошко
"Внимание! Данная программа имеет известные проблемы совместимости с данной версией Windows"
Visual Studio 2012 несовместим с семеркой? Ну охуеть теперь.