obfuscated code

i am have given the following code. all the coding looks weird to me, so how do i translate the code back to its original form??

#include <iostream>
using namespace std;

int _[3]={1},___=7744,__[2]={((1<<5)-(1<<3))};void a(){(_[0]>__[1])?(cout<<_[1]+(((2<<2)*('z'>>1)*'R')>>1)<<endl):(_[2]=___%10,_[1]+=_[2]*_[0],___/=10,_[0]*=__[0],a(),cout<<' ');}void f(int ___,int b){(!b?(!(___-1)?(cout<<(_[2]+1)<<' '):(cout<<' ')):(f(b,___%b),(cout<<' ')));}void g(){while(_[2]){cout<<(f(_[2]--,_[1]),' ');}};;main(int*____, char*___[]){__[1]=(__[1]*=(__[1]=__[0],__[1]*=__[0]))/__[0];a();_[0]=atoi(___[1]);_[1]=atoi(___[2]);_[2]=_[0];cout<<endl<<(g(),' ')<<endl;}
First you run it through a code formatter:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
using namespace std;

int _[3]= {1},___=7744,__[2]= {((1<<5)-(1<<3))};
void a()
{
    (_[0]>__[1])?(cout<<_[1]+(((2<<2)*('z'>>1)*'R')>>1)<<endl):(_[2]=___%10,_[1]+=_[2]*_[0],___/=10,_[0]*=__[0],a(),cout<<' ');
}
void f(int ___,int b)
{
    (!b?(!(___-1)?(cout<<(_[2]+1)<<' '):(cout<<' ')):(f(b,___%b),(cout<<' ')));
}
void g()
{
    while(_[2])
    {
        cout<<(f(_[2]--,_[1]),' ');
    }
};;
main(int*____, char*___[])
{
    __[1]=(__[1]*=(__[1]=__[0],__[1]*=__[0]))/__[0];
    a();
    _[0]=atoi(___[1]);
    _[1]=atoi(___[2]);
    _[2]=_[0];
    cout<<endl<<(g(),' ')<<endl;
}


Then you start giving the variables and functions meaningful names based on what they're for and what they do.
and simplify mathematical operations, (((2<<2)*('z'>>1)*'R')>>1) equals 20008
this looks like a homework assignment to be due tomorrow :D
Topic archived. No new replies allowed.