📜 ⬆️ ⬇️

Incomprehensible code

Sometimes people do weird things. Today, for example, after a quick glance at the simplest C ++ program, I had a desire to turn it into a cryptogram :) With simple manipulations, all the significant code is written in one line, and then it is brought into such a confusing state as fantasy allows. It is clear that there are special championships for writing similar opuses, even special programming languages, and the disassembled code does not look much better. But I am interested in another question: can a person who is not familiar with the task understand what this program is doing? Personally, on my mind there is one way to do this, and maybe a reader who accidentally wandered here to cope with it? For this I spread the code on display.
#include <cstdio>
#include <cstdlib>
int a,b,c;
int main(){
exit(\
scanf( "%d %d %d" ,&a,&b,&c) && printf( ( ( a > 0 ) && ( a < 0x20 ) && ( b > 0 ) && ( b < (1<<5) ) &&\
( ( b != 0x2 ) ? ( a <= 0x1e + ( ( b % 0x2 && b < 0x8 ) || ( ! ( b % (1<<1) ) && ( b >= (1<<3) ) ) ) ):\
( a <= 0x1c + ( ( ! ( c % 0x4 ) && ( c % 0x64 ) ) || ( ! ( c % 0x190 ) ) ) ) ) )?\
( "yes" ) : ( "no" ) ) && 0\
);
}


* This source code was highlighted with Source Code Highlighter .



')

Source: https://habr.com/ru/post/87518/


All Articles