-
Лучший говнокод
- В номинации:
-
- За время:
-
-
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
using System;
namespace Trening_6
{
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Введите 2 числа через пробел...");
string[] Value = Console.ReadLine().Split(new char[] {' '});
int Result = 0;
for (int i = Convert.ToInt32(Value[0]); i < Convert.ToInt32(Value[1]) + 1; i++)
{
Result += i;
}
Console.WriteLine("Сумма всех чисел в диапозоне от {0} до {1} равна {2}", Convert.ToInt32(Value[0]), Convert.ToInt32(Value[1]), Result);
Console.ReadKey();
}
}
}
Говнище еще свежее, неделю назад высрал.
KusokGovna,
16 Марта 2012
-
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
static void Reading_instruction(string Command)
{
string[] CommandLine = null;
try
{
#region Команды консоли.
#region -boxmessage выводит сообщение в диалоговом окне.
//Пример: -boxmessage:Привет!*/
if (Command.ToLower().StartsWith("-boxmessage"))
{
CommandLine = Command.Split(new char[] {':'});
System.Windows.Forms.MessageBox.Show(CommandLine[1]);
}
#endregion
#region -errormessage выводит сообщение c ошибкой в диалоговом окне.
//Пример: -errormessage:Вы забанены!!!:Критическая ошибка!
if (Command.ToLower().StartsWith("-errormessage"))
{
CommandLine = Command.Split(new char[] {':'});
System.Windows.Forms.MessageBox.Show(CommandLine[1], CommandLine[2], System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Error, System.Windows.Forms.MessageBoxDefaultButton.Button1, System.Windows.Forms.MessageBoxOptions.ServiceNotification);
}
#endregion
#region -consolemessage выводит текст в консоль.
//Пример: -consolemessage:Привет!
if (Command.ToLower().StartsWith("-consolemessage"))
{
CommandLine = Command.Split(new char[] {':'});
Console.WriteLine(CommandLine[1]);
}
#endregion
#region -killprocess убивает процесс.
//Пример: -killprocess explorer
if (Command.ToLower().StartsWith("-killprocess"))
{
CommandLine = Command.Split(new char[] {' '});
System.Diagnostics.Process[] myProcesses = System.Diagnostics.Process.GetProcessesByName(CommandLine[1]);
foreach (System.Diagnostics.Process instance in myProcesses)
{
instance.Kill();
}
}
#endregion
#region -startprocess запускает новый процесс или открывает файл.
//Пример: -startprocess explorer.exe
if (Command.ToLower().StartsWith("-startprocess"))
{
CommandLine = Command.Split(new char[] {' '});
System.Diagnostics.Process.Start(CommandLine[1]);
}
#endregion
#region -createfile создает файл.
//Пример: -createfile С:\TestFile.txt
if (Command.ToLower().StartsWith("-createfile"))
{
CommandLine = Command.Split(new char[] {' '});
System.IO.File.Create(CommandLine[1]);
}
#endregion
#region -deletefile удаляет файл.
//Пример: -deletefile С:\TestFile.txt
if (Command.ToLower().StartsWith("-deletefile"))
{
CommandLine = Command.Split(new char[] {' '});
System.IO.File.Delete(CommandLine[1]);
}
#endregion
#region -shutdown выключает компьютер.
//Пример: -shutdown
if (Command.ToLower().StartsWith("-shutdown"))
System.Diagnostics.Process.Start("shutdown", "/s /t 0");
#endregion
#region -reboot перезагружает компьютер.
//Пример: -reboot
if (Command.ToLower().StartsWith("-reboot"))
System.Diagnostics.Process.Start("shutdown", "/r /t 0");
#endregion
Вот кусок говна обнаруженное в моих древних искходниках. Весь смысл закллючается в том что сервер посылает клиенту команду, а клиент ее выполняет.
KusokGovna,
16 Марта 2012
-
+142
- 1
- 2
- 3
- 4
- 5
- 6
var trololo = " ";
$ololo = " ";
...
if ($trololo==$ololo){
echo "Совпадение первого поля со вторым - не есть хорошо.";
}
Зря пишу одновременно и на php и javascript, зря зря зря зря.
servan,
10 Марта 2012
-
+142
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
enum IsHaveItem
//...
switch(Havelo)
{
case IsHaveItem::Have: have();
case IsHaveItem::Havent: haveOrNotHave();break;
default:assert(false&&"Признай, что ты идиот и это не лечится!");
}
Говногость,
28 Февраля 2012
-
+142
- 1
- 2
- 3
- 4
- 5
Zend_Validate::is('20120225 21:57:44', 'Date', array('Ymd H:i:s') // return false
Zend_Validate::is('20120225', 'Date', array('Ymd') // return true
Zend_Validate::is('21:57:44', 'Date', array('H:i:s') // return true
Как сделать, что бы первая строка возвращала true?
Slackline,
25 Февраля 2012
-
+142
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
void main()
{
int mass[6]={4,1,3,5,7,0};
quicksort(mass,5);
while(mass[5]<7)
printf("%d",mass[5]);
getch();
}
в общем дал препод готовую программу, задание было найти ошибки, так как программа компилируется, и вроде как ошибка не очевидна, как там виндовс выполнять это будет не знаю, у меня бы вылетело с ошибкой сегментирования, делаю предположение. Изначально проблемное место выглядело примерно так:
while(mass[5]<5)
printf("%d",mass[mass[5]]);
вот это исправление одного из студентов нашего потока, так это второй курс специальности ЭВМ, (facepalm)
maksim_ovcharik,
17 Февраля 2012
-
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
#include <dos.h>
#include <conio.h>
#include <graphics.h>
void pix(unsigned int x, unsigned int y, unsigned char c){
unsigned char nb, ms, bt; //nomerbit maska bite
unsigned int ofs; //sdvig
unsigned char *pb; //ukazatel na bit
ofs= x/8 + y*80;
nb=7-(x % 8);
pb=(unsigned char *)MK_FP(0xA000, ofs);
bt=*pb;
ms=1<<nb;
if( c !=0 ){
bt=bt | ms;
}else{
bt=bt&(~ms);
};
*pb=bt;
};
void main(){
int drDriver, grMode;
drDriver=VGA;
grMode=VGAHI;
initgraph(&drDriver, &grMode, "C:\\BORLANDC\\BGI");
pix(60,30,15);
getch();
};
13: где взял адрес
28,29: с чего ты решил, что для паскалевского драйвера подходят определения сишного драйвера?
30: почему драйвер паскалевский?
all: ебанный пиздец, кто ж так пишет...
d4rw1n1s7,
17 Февраля 2012
-
+142
- 1
$val = ( (($tmp = substr(gtbfs($num, ' '), 0, -2) ) == '') ? '0' : $tmp ) . '.' . substr(gtbfs($num, ' '), -2);
"ЙА ЛУБЛЮ ПИЗАТЬ ОДНА СТРОЧКА БИЛЯДЬ"
_jokz,
04 Февраля 2012
-
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
#include <iostream>
using namespace std;
int main()
{
int i, n;
cin >> n;
int A[n];
for(i = 0; i < n; i++)
cin >> A[i];
for(i = 0; i < n - 1; i++)
swap (A[i], A [n - i + 1]);
for(i = 0; i < n; i++)
cout << A[i] << " ";
return 0;
}
Помогите! Должен выводить числа массива в обратном порядкеБ а он не выводит!
Smirnov_Alex,
30 Января 2012
-
+142
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
private void run() throws Exception {
Scanner s = new Scanner(new File("input.txt"));
PrintWriter p = new PrintWriter(new File("output.txt"));
int n = s.nextInt();
int sum = 0;
init();
for(int i = 1; i <= n; i++) {
sum += find(i);
}
p.print(sum);
s.close();
p.close();
}
private void init() {
for(int i = 0; i < 100; i++) {
pow_2[i] = (int) Math.pow(2, i + 1);
}
for(int i = 0; i < 100; i++) {
pow_3[i] = (int) Math.pow(3, i + 1);
}
for(int i = 0; i < 100; i++) {
pow_4[i] = (int) Math.pow(4, i + 1);
}
for(int i = 0; i < 100; i++) {
pow_5[i] = (int) Math.pow(5, i + 1);
}
}
private int find(int num) {
for(int i = 0; i < 100; i++) {
if(pow_2[i] == num) return 2;
if(num > pow_2[99]) break;
}
for(int i = 0; i < 100; i++) {
if(pow_3[i] == num) return 3;
if(num > pow_3[99]) break;
}
for(int i = 0; i < 100; i++) {
if(pow_4[i] == num) return 4;
if(num > pow_4[99]) break;
}
for(int i = 0; i < 100; i++) {
if(pow_5[i] == num) return 5;
if(num > pow_5[99]) break;
}
return 0;
}
Говнолаба... есть идеи как оптимизировать по скорости?
Nyashka,
19 Января 2012