- 1
- 2
- 3
- 4
- 5
- 6
#define begin {
#define end }
//....
#define repeat do{
#define until(a) }while(!(a))
// и т.д.
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+48.3
#define begin {
#define end }
//....
#define repeat do{
#define until(a) }while(!(a))
// и т.д.
Боян, конечно, просто вспомнил, глядя на предыдущий говнокод с макросами. Это в институте препод на одной из лекций всерьёз писал на доске.
Видимо, паскальщик еще советской закалки :)
+144.7
#include <iostream>
#define lulz int
#define lulZ main()
#define luLz {
#define luLZ }
#define lUlz cout
#define lULz cin
#define lUlZ ;
#define LuLZ <<
#define LuLz >>
#define LULz =
#define LULZ +
#define lolz endl
lulz lulZ
luLz
lulz Lulz lUlZ
lUlz LuLZ" Смешная сумма " LuLZ lolz lUlZ
lULz LuLz Lulz lUlZ
lUlz LuLZ Lulz lUlZ
lUlz LuLZ" + " lUlZ
lulz lULZ lUlZ
lUlz LuLZ "LULZ?" LuLZ lolz lUlZ
lULz LuLz lULZ lUlZ
lUlz LuLZ Lulz LuLZ " + " LuLZ lULZ LuLZ " = " LuLZ Lulz + lULZ lUlZ
luLZ
"Смешная сумма" (c) автор
+63.8
const size_t& len() const {return _c_str?_len:*(size_t*)0;} //нах это нужно??
P.S. А Я САМ НЕ ЗНАЮ ГДЕ ЗДЕСЬ СИ-КРЕСТ-КРЕСТ!!!!1
+55.5
//------------------------------- COMPARE -------------------------------------
// Function to compare two strings on a mask, using a question mark and
// asterisk.Question mark matches any single character. The asterisk matches
// any signs of a minimum length of zero. maximum length is not limited. Only
// the next character in the mask has a value when there is a coincidence.
int compare(const char pat[],const char text[],int rec_ex)
{
bool flag = false; // flag show if working on "star"
int pat_len ,txt_len, // lehtghs of pattern and text
flagc, // counter and position i check
shift=0; // shift position
pat_len = (int)strlen(pat); // get lehtgh of pattern
txt_len = (int)strlen(text); // get lehtgh of text
if(rec_ex == 1 || (!pat_len && !txt_len)) // check if have to check some
return(1); // if yes return 1 or if have exit
else if(rec_ex == pat_len) // else return 0 becose not check that
return (0); // return 0
for(flagc=0;flagc < pat_len;flagc++)
if(pat[flagc] == '*' && flagc + 1 == pat_len)
return(compare(pat,text,1));// end of check return 1
else if(pat[flagc] == '*')
flag = true; // start * compare set flag true
else if(pat[flagc] != '?')
{
if(toupper(pat[flagc]) != toupper(text[flagc+shift]) && !flag)
return(compare(pat,text,pat_len)); // bad char and no star
else if(toupper(pat[flagc]) == toupper(text[flagc+shift]) && flag)
flag = false; // set flag false position
else if(toupper(pat[flagc]) != toupper(text[flagc+shift]) && flag)
shift++;
}
else if(pat[flagc] == '?')
{ // check if have ? in star operation
if(toupper(pat[flagc]) == toupper(text[flagc+shift]) && flag)
flag = false; // set flag false position
else if(toupper(pat[flagc]) != toupper(text[flagc+shift]) && flag)
shift++; // add one more into shift
}
if((flagc+shift < txt_len && !flag) // text have nore chars and
|| (flagc+shift == txt_len +1 && pat[pat_len+1] != '*'))
return(compare(pat,text,pat_len)); // and next char in pattern no star
else
return(compare(pat,text,1)); // end of pattern and text
}
Вот на после завтра нужно по программированию функцию написать- рекурсивную для сравнения строк по маске.
Написал :-) якобы рекурсивную функцию :-)
+146.9
class ToBeOrNotToBe{};
void distortion(ToBeOrNotToBe...)
{
}
Код компилируется в 2008 MVS
+72.4
this->pRCH->setChckSize(this->pRCH->getChckSize() +
this->pvRP->at(this->pvRP->size() - 1)->getRHBidR()->getRHBSize()
+ sizeof(*this->pvRP->at(this->pvRP->size() - 1)->getRHBidR()->getRHBid()));
this->pRBCH->setChckSize(this->pRBCH->getChckSize() +
this->pvRP->at(this->pvRP->size() - 1)->getRHBR()->getRHB()->getRBSize());
Автор кода отчаянно доказывал прямоту кода...
+923.7
vector<
#ifdef O_UNICODE
wstring
#else
string
#endif
> get_file_list(
#ifdef O_UNICODE
wstring
#else
string
#endif
dir) {
#ifdef O_UNICODE
wdirectory_iterator
#else
directory_iterator
#endif
e;
vector<
#ifdef O_UNICODE
wstring
#else
string
#endif
> ret;
for (
#ifdef O_UNICODE
wdirectory_iterator
#else
directory_iterator
#endif
d(dir); d != e; d++) {
if (is_directory(d->status())) {
vector<
#ifdef O_UNICODE
wstring
#else
string
#endif
> tmp = get_file_list(dir +
#ifdef O_UNICODE
L
#endif
"\\" + d->filename());
for (unsigned int i = 0; i < tmp.size(); i++)
ret.push_back(tmp[i]);
} else
ret.push_back(dir +
#ifdef O_UNICODE
L
#endif
"\\" + d->filename());
}
return ret;
}
Условная компиляция, однако
+144.2
i+=i+++i--;
Access denied!!!
+67.7
for(__=_;__<___;__++) C++;
Недавно увидел такие имена переменных, очарован, теперь срочно переделываю весь проект!
PS. Тело цикла сами знаете для кого.
+58.5
template <int n>
struct fibonacci
{
static int result()
{
return fibonacci<n-2>::result() + fibonacci<n-1>::result();
}
};
........... и где-нибудь в коде:
fibonacci<7>::result();
Работает в msvc 2008 sp1 и более ранних. g++ и некоторые другие отваливаются с ругательствами на урезмерную рекурсию. Особо злостным маньякам можно рекомендовать понаслаждаться просмотром поля "memory usage" процесса cl.exe :)
Также можно (но не нужно) устроить ddos подвесив халявный компилятор здесь:
http://www.dinkumware.com/exam/default.aspx