- 1
- 2
- 3
- 4
- 5
template<class Container>
void COW_guard(Container& forUnCow){
const Container c={};
cc+=c;
}
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+17
template<class Container>
void COW_guard(Container& forUnCow){
const Container c={};
cc+=c;
}
+128
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<dict>
<key>author</key>
<string>Nobody</string>
<key>name</key>
<string>my-theme</string>
<key>settings</key>
<array>
<!-- ... -->
<dict>
<key>name</key>
<string>Attribute</string>
<key>scope</key>
<string>entity.other.attribute-name</string>
<key>settings</key>
<dict>
<key>fontStyle</key>
<string></string>
<key>foreground</key>
<string>#006E28</string>
</dict>
</dict>
<!-- ... -->
</array>
</dict>
</plist>
XML. Такой загадочный и энтерпрайзный.
// Цветовая схема для Sublime Text (или TextMate)
+6
#include <iostream>
#include <conio.h>
#include <clocale>
using namespace std;
int files; int disc_D(); int disc_E(); int disc_C();
int resursefunction()
{char s;
cout << "Выберите диск" << endl;
cout <<"1-D:\\" << endl;
cout <<"2-C:\\" << endl;
cout <<"3-E:\\" << endl;
cout <<"0 - рабочий стол" << endl;
cin >> s;
if(s == '1') return disc_D();
if(s == '2') return disc_C();
if(s == '3') return disc_E();
if(s == '0') return main();
_getch();}
int main()
{ char vibor;
setlocale( LC_ALL, "Russian" );
cout << "\t\t\t\tРабочий стол" << endl;
cout << "\n\n";
cout << "1-Управление ресурсами" << endl;
cout << "2-Программы" << endl;
cout << "3-Игры" << endl;
cout << "4-Выход из системы" << endl;
cin >> vibor;
if(vibor == '1') resursefunction();
_getch();
return main();}
int disc_D()
{ int res, a;
char vv;
cout << "D:\\" << endl;
cout << "На диске" << endl;
cout << "5 - папок" << endl;
cout << files << " - файлов" << endl;
cout << "1 - создать файл" << endl;
cout << "2 - удалить файл" << endl;
cout << "0 - назад" << endl;
cin >> vv;
if(vv == '1')
{cout << "Введите сколько создать файлов"; cin >> a; res = files + a;
res = files + a;}
if(vv == '2')
{cout << "Введите сколько удалить файлов"; cin >> a; res = files - a;
res = files - a;}
if(vv == '0') return resursefunction();
files = res;
return disc_D();}
int disc_E()
{
int res, a;
char vv;
cout << "E:\\" << endl;
cout << "На диске" << endl;
cout << "7 - папок" << endl;
cout << files << " - файлов" << endl;
cout << "1 - создать файл" << endl;
cout << "2 - удалить файл" << endl;
cout << "0 - назад" << endl;
cin >> vv;
if(vv = '1')
{cout << "Введите сколько создать файлов"; cin >> a; res = files + a;
res = files + a;}
if(vv == '2')
{cout << "Введите сколько удалить файлов"; cin >> a; res = files - a;
res = files - a;}
if(vv == '0') return resursefunction();
files = res;
return disc_E();}
int disc_C()
{int res, a;
char vv;
cout << "C:\\" << endl;
cout << "На диске" << endl;
cout << "5 - папок" << endl;
cout << files << " - файлов" << endl;
cout << "1 - создать файл" << endl;
cout << "2 - удалить файл" << endl;
cout << "0 - назад" << endl;
cin >> vv;
if(vv = '1')
{cout << "Введите сколько создать файлов"; cin >> a; res = files + a;
res = files + a;}
if(vv == '2')
{ cout << "Введите сколько удалить файлов"; cin >> a; res = files - a;
res = files - a; }
if(vv == '0') return resursefunction();
files = res;
return disc_C();}
Еще нашел на форумах. К сожалению форматирование пришлось убить, иначе оно не помещалось целиком
+143
.686
.model tiny
Весьма специфичная ошибка при использовании masm32.
+14
#include <iostream>
#include <conio.h>
#include <math.h>
using namespace std;
int main()
{
setlocale(0,"Russian");
cout<<"Пишиш без a,b,c,приклад: 2 5 -12 або натиснеш на Enter и пишеш вниз,"<<endl;
cout<<"ПИШИ:"<<endl;
float D;
int repetare=0;
int a;
int b;
int c;
int x1;
int x2;
repetare;
{
while(repetare<100)
{
cout<<"a=";
cin>>a;
cout<<"b=";
cin>>b;
cout<<"c=";
cin>>c;
D=(b^2-(4*a*c))*(-1);
x1=(b-sqrt(D))/(2*a);
x2=(b+sqrt(D))/(2*a);
if (D>0)
{
cout<<"D="<<D<<endl;
cout<<"x1="<<x1<<endl;
cout<<"x2="<<x2<<endl;
cout<<"Имеет два кореня"<<endl;
}
if (D<0)
{
cout<<"D="<<D<<endl;
cout<<"Не имеет кореней"<<endl;
}
if(D=0)
{
cout<<"D="<<D<<endl;
cout<<"x1="<<x1<<endl;
cout<<"Имеет один корень"<<endl;
}
repetare++;
}
}
getche();
return 0;
}
С одного из сайтов игроделов. Просто оставлю это здесь
+103
if (s[n][c]='1')and(s[n][c+1]='0')and(s[n+1][c]='0')and(n=1)and(c=1) then writeln('*');
if (s[n][c]='1')and(s[n][c-1]='0')and(s[n+1][c]='0')and(s[n][c+1]='0')and(n=1) then writeln('*');
if (s[n][c]='1')and(s[n][c-1]='0')and(s[n+1][c]='0')and(n=1)and(c=10) then writeln('*');
if (s[n][c]='1')and(s[n-1][c]='0')and(s[n][c-1]='0')and(s[n+1][c]='0')and(c=10) then writeln('*');
if (s[n][c]='1')and(s[n-1][c]='0')and(s[n][c-1]='0')and(n=10)and(c=10) then writeln('*');
if (s[n][c]='1')and(s[n][c+1]='0')and(s[n-1][c]='0')and(s[n][c-1]='0')and(n=10) then writeln('*');
if (s[n][c]='1')and(s[n][c+1]='0')and(s[n-1][c]='0')and(n=10)and(c=1) then writeln('*');
if (s[n][c]='1')and(s[n+1][c]='0')and(s[n][c+1]='0')and(s[n-1][c]='0')and(c=1) then writeln('*');
if (s[n][c]='1')and(s[n][c+1]='.')and(s[n+1][c]='.')and(n=1)and(c=1) then writeln('*');
if (s[n][c]='1')and(s[n][c-1]='.')and(s[n+1][c]='.')and(s[n][c+1]='.')and(n=1) then writeln('*');
if (s[n][c]='1')and(s[n][c-1]='.')and(s[n+1][c]='.')and(n=1)and(c=10) then writeln('*');
if (s[n][c]='1')and(s[n-1][c]='.')and(s[n][c-1]='.')and(s[n+1][c]='.')and(c=10) then writeln('*');
if (s[n][c]='1')and(s[n-1][c]='.')and(s[n][c-1]='.')and(n=10)and(c=10) then writeln('*');
if (s[n][c]='1')and(s[n][c+1]='.')and(s[n-1][c]='.')and(s[n][c-1]='.')and(n=10) then writeln('*');
if (s[n][c]='1')and(s[n][c+1]='.')and(s[n-1][c]='.')and(n=10)and(c=1) then writeln('*');
if (s[n][c]='1')and(s[n+1][c]='.')and(s[n][c+1]='.')and(s[n-1][c]='.')and(c=1) then writeln('*');
Конец решения первой задачи все из той же дистанционки.
На этот раз мопед не мой, а одной юной дамы.
Вот за ЭТО я и недолюбливаю Паскаль: иногда код хер прочитаешь. А еще путаница с типами. И логикой. Гы.
+86
https://github.com/wiistriker/govnokod.ru
Развлечемся?
+95
function IntToHex(Num: Int64; Digits: Byte): String;
type
DataInt = Array[0..7] of Byte;
var
I:Byte;
Data: ^DataInt;
begin
Data := @Num;
Result := '';
for I := Trunc(Digits/2)-1 downto 0 do begin
if SizeOf(DataInt) < I then
Result := Result+'00'
else begin
case Data^[I] of
0: Result := Result+'00';
1: Result := Result+'01';
2: Result := Result+'02';
{ ........... }
253: Result := Result+'FD';
254: Result := Result+'FE';
255: Result := Result+'FF';
end;
end;
end;
end;
Давно писал функцию для перевода числа в 16-ричное представление.
Причина - нужно было отдельную функцию без лишнего.
Вот такой вот жестокий быдло код :))
−98
# -*- coding: cp1251 -*-
beer = u"бутылок пива стоят на столе. Одна упала."
botle = 100
for i in range(1, 100):
print (botle-i), beer
print u"Нету больше пива на столе :-("
Пива не будет :-(
+140
<!-- Скрипт иерархичесского аккардиона -->
Не говнокод, но говноречь - 3 ошибки в 2 словах.
"Девелоперы" научились подключать jQuery, а вот русский язык пока что не осилили.
Эти грамотеи работают на "Первом канале", см. http://www.1tv.ru/videoarchiver/.