- 1
- 2
- 3
- 4
- 5
- 6
<body>
<br>
<?include'1.txt';?>
<br\>
</body>
</html>
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+145
<body>
<br>
<?include'1.txt';?>
<br\>
</body>
</html>
+151
Док = СоздатьОбъект("Документ.Документ1");
Док.ВыбратьДокументы(Дата1, Дата2);
Пока Док.ПолучитьДокумент()=1 Цикл
Док.ВыбратьСтроки();
Пока Док.ПолучитьСтроку() = 1 Цикл
Док2 = СоздатьОбъект("Документ.Документ2");
Док2.ВыбратьДокументы(Дата1,Дата2);
Сумма = 0;
Пока Док2.ПолучитьДокумент()=1 Цикл
Опер = СоздатьОбъект("Операция");
Если Опер.НайтиОперацию(Док2) = 1 Тогда
Опер.ВыбратьПроводки();
Пока Опер.ПолучитьПроводку() = 1 Цикл
Если (Опер.Кредит.Субконто(1) = Док.Контрагент) Тогда
Сумма = Сумма + Опер.Сумма;
КонецЕсли;
КонецЦикла;
КонецЕсли;
КонецЦикла;
КонецЦикла;
КонецЦикла;
Больше циклов по одним и тем же данным!
+149
$query = 'SELECT mapid3 FROM #__mapsfo WHERE objurl LIKE "%'.$id.'%"';
$db->setQuery($query);
$m_id = $db->loadResult();
$query = 'SELECT id FROM #__mapsfo WHERE mapid3='.$m_id;
$db->setQuery($query);
$o_id = $db->loadObjectList();
+148
function br($count=1) {
$c=0;
do {
echo '<br>';
$c++;
} while($c!=$count);
}
in <- <?php br(10); ?>
out -> <br><br><br><br><br><br><br><br><br><b r>
:DDDDD
+152
$str.= "<div class=\"matchtour2\"><table class='maintable' align=right width=590 cellspacing=0><tr bgcolor=#56B945 style='color:white; margin:0;' class='header'><td align=center width=50><b>время</b></td><td align=center><b>событие</b></td><td width=50 align=center><b>победа<br>1</b></td><td width=50 align=center><b>ничья<br>X</b></td><td width=50 align=center><b>пoбеда<br>2</b></td><td width=50> </td></tr></table></div><br><br>";
Мечта верстальщика
+150
<?php
require_once "class/db.php";
require_once "secrets.php";
ini_set("error_reporting","E_ALL");
$db_obj= new db($mysql_host,$mysql_user,$mysql_pass,$mysql_db);
while ($row=$object->sql_fetch_assoc("SELECT id, name FROM categories ORDER BY sort ASC"))
{
$cats[] = $row;
}
$cats_list = "";
while ($cats){
{
$cats_list .= "<options value=\"" . $cats['id'] . "\">" . $cats['name'] . "</options>";
}
$form = <<<FORM
<form action='" . $PHP_SELF . "' method='post' enctype='multipart/form-data'>
<b>Поиск</b><br>
<tr>
<td>
<b>Cтрока поиска:</b><input type=\"text\" size=\"40\" name=\"string\">
</td>
<td>
<b>Выберете категорию</b>
<select name=\"cats\">
$cats_list
</select>
</td>
</tr>
</form>
FORM;
print ($form);
?>
+151
$result['msg'] .= '<form action="" method="POST">';
$result['msg'] .= 'I RECEIVED ';
$result['msg'] .= '<select name="order_grade" width="10">';
$result['msg'] .= '<option></option>';
$result['msg'] .= '<option value="4"> A </option>';
$result['msg'] .= '<option value="3"> B </option>';
$result['msg'] .= '<option value="2"> C </option>';
$result['msg'] .= '<option value="1"> D </option>';
$result['msg'] .= '<option value="0"> F </option>';
$result['msg'] .= '</select>';
$result['msg'] .= ' FOR THIS PAPER ';
$result['msg'] .= '<input type="submit" name="set_grade" value="Submit my grade">';
$result['msg'] .= '</form>';
Зачем так поступать?
+144.1
#ifdef TYPE_A
#define LEN 10
#else
#define LEN_9 9
#endif
#ifdef TYPE_A
char str[LEN + 20];
#else
char str[LEN_9 + 20];
#endif
Макросня
+185
define('KEY', md5('Obama'));
if($_GET['key'] != KEY) {
...
}
таки обамосекьюрность))
встретилось в одном большом проекте, который успешно работает и процветает по сей день
+139.5
#include <iostream>
#include <deque>
#include <time.h>
using namespace std;
int arr[10][10] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
#define SHIPS 1
struct point{
int x, y;
};
int num = -1, count = 0;
deque<point> ship;
int way[] = {0, 0, 0, 0};
void step(){
for (int i = 0; i < 10; i++){
for (int j = 0; j < 10; j++)
cout << arr[i][j] << ' ' ;
cout << '\n';
}
cout << '\n';
if (num == ship.size()){
memset(way, 0, sizeof(way));
while(!ship.empty()){
arr[ship.front().x + 1][ship.front().y] = 7;
arr[ship.front().x + 1][ship.front().y + 1] = 7;
arr[ship.front().x][ship.front().y + 1] = 7;
arr[ship.front().x + 1][ship.front().y - 1] = 7;
arr[ship.front().x - 1][ship.front().y + 1] = 7;
arr[ship.front().x - 1][ship.front().y - 1] = 7;
arr[ship.front().x][ship.front().y - 1] = 7;
arr[ship.front().x - 1][ship.front().y] = 7;
ship.pop_front();
}
count++;
if (count == SHIPS) {
cout << "Win" << '\n';
exit(0);
}
cout << num << " was killed" << '\n';
num = -1;
}
int x, y;
point tmp;
if (ship.empty()){
x = rand()%10;
y = rand()%10;
while (arr[x][y] == 7){
x = rand()%10;
y = rand()%10;
}
if (arr[x][y] != 0 && arr[x][y] != 7){
num = arr[x][y];
tmp.x = x;
tmp.y = y;
ship.push_front(tmp);
arr[x][y] = 7;
if (x > 0) if (arr[x][y - 1] != 7) way[0] = 1;
if (y > 0) if (arr[x - 1][y] != 7) way[1] = 1;
if (x < 9) if (arr[x][y + 1] != 7) way[2] = 1;
if (y < 9) if (arr[x + 1][y] != 7) way[3] = 1;
step();
}else{
arr[x][y] = 7;
return;
}
}else{
int t = rand()%4;
while (way[t] == 0){
t = rand()%4;
}
switch(t){
case 0:
x = ship.back().x;
y = ship.back().y - 1;
if(arr[x][y] == num){
way[1] = 0;
way[3] = 0;
tmp.x = x;
tmp.y = y;
ship.push_back(tmp);
arr[x][y] = 7;
step();
}else{
arr[x][y] = 7;
way[0] = 0;
return;
}
Морской бой