- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
vector<long long> fib;
for
(
long long a=1,b=1;
b=a+b,a=a+b,a>0&&b>0;
cout<<b<<" "<<a<<endl,
fib.push_back(b),
fib.push_back(a)
);
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 6
+148
vector<long long> fib;
for
(
long long a=1,b=1;
b=a+b,a=a+b,a>0&&b>0;
cout<<b<<" "<<a<<endl,
fib.push_back(b),
fib.push_back(a)
);
Just outputting fibonacci numbers as pairs and storing them in a vector...
+161
function get_phrase()
{
global $words;
global $phrase;
$phrase = implode(" ", $words);
if(strlen($phrase) < 4) return;
}
I was amazed to find this!?! The last line of the function rationalized my day...
+179
function redirect_page($script_name)
{
$location = $script_name;
?><script>document.location.href="<? echo $location; ?>";</script><?
}
Я нашел это говно в наш код!
+169
<?php
exit
(
empty($_POST['key']) ||
empty($_POST['time']) ||
empty($_POST['email']) ||
(int)$_POST['time'] != $_POST['time'] ||
strlen((int)$_POST['time']) != strlen($_POST['time']) ||
!preg_match('/^[^@]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$/', $_POST['email']) ||
($_SERVER['REQUEST_TIME'] - $_POST['time']) > 60 * 60 ||
md5(str_rot13(md5($_POST['time']))) != $_POST['key']
?'-':'+'
);
?>
Вот Ajax ответ
+161
if
(
!(
(
strlen($chld_phone) == 10 &&
(
substr($chld_phone,0,3) == '087' ||
substr($chld_phone,0,3) == '088' ||
substr($chld_phone,0,3) == '089'
)
) ||
(
strlen($chld_phone) == 12 &&
(
substr($chld_phone,0,5) == '35987' ||
substr($chld_phone,0,5) == '35988' ||
substr($chld_phone,0,5) == '35989'
)
)
)
)
{
//Грешка
}
Телефон проверки :)
+184
$multiplier = 1.15;
$allowedLen = 56;
echo
(
(
(
$allowedLen -
(
strlen($resSingle->name) * $multiplier
)
) > 0
) ?
(
(
isset
(
$resSingle->address
[
$allowedLen -
(
strlen($resSingle->name) * $multiplier
)
]
) ?
(
' - ' . substr
(
$resSingle->address , 0 , $allowedLen -
(
strlen($resSingle->name) * $multiplier
)
) .
'...'
) :
(
' - ' . $resSingle->address
)
)
) :
(
''
)
);
Here's my string formatting echo. Name is upper case and address is lowercase. I needed to echo this information, and the rows should be with ~equal length. Enjoy!