Printing out a diamond with a user-inputted size
I see a number of things that could help you improve your code.

Don't disregard readability

Readability of code is always of use and always of interest, even if you're the only one who ever sees the code.  Since, by definition, you're asking for a code review by posting here, even that assumption is clearly faulty, because every reviewer is going to have to read and understand your code to comment usefully on it.  Even if you really were the only person to ever look at the code, if you decide to modify it some time later, readability will be important to you.  

Decompose your program into functions

All of the logic here is in main in one rather long and dense chunk of code.  It would be better to decompose this into separate functions.

Don't further clutter trinary operators

The code currently includes this line:

spaces = (lines % 2 == 0) ? spaces = 0 : spaces = 1;


The problem is that the spaces = 0 and spaces = 1 on the right side are wholly uneccesary.  If you must use trinary operators, (and I question that in this case), use them correctly:

spaces = (lines % 2 == 0) ? 0 : 1;


Simpler, and better in my view, would be this:

spaces = lines &amp; 1; 


Rethink your algorithm

The biggest improvements are often found in simply rethinking and reimplementing the basic algorithm. In this case, each line is 0 or more spaces, followed by 1 or more stars.  For each increasing line in the first half, the number of spaces decrements by one and the number of stars increments by two.  A little bit of examination with paper and pencil will quickly yield algebraic expressions for the number of spaces and number of stars for each line in the top half of an n-line diamond pattern.  The bottom half is simply the reverse of the top half.  This suggests a simple algorithm.

Putting it all together

Your original program, as posted, was 44 lines long.  Using all of these hints, and with better readability, here it is in exactly half that many lines:

#include &lt;iostream&gt;

void multiprint(unsigned n, char ch) {
    for ( ; n; --n) 
        std::cout &lt;&lt; ch;
}

void line(unsigned n, unsigned maxline) {
    unsigned half = (maxline-1)/2;
    if (n &gt; half) n = maxline - n - 1;
    multiprint(half - n, ' ');
    multiprint(n*2 + 1, '*');
    std::cout &lt;&lt; '\n';
}

int main() {
    int lines;
    std::cin &gt;&gt; lines;

    for (int i =0; i &lt; lines; ++i)
        line(i, lines);
}