Simplifying a practice project!

I have been teaching myself c++ for a few weeks now and searched for some beginner projects to do. I decided to add on to one of them and make an inverse asterisk triangle. Basically since i'v only been programing for a little while I would like some suggestions on how to simplify such a program here is the code:

#include <iostream>
#include <string>

using namespace std;

int main()
{
cout << "Enter number of '*' at top of triangle: ";
cout << endl;

int input;

cin >> input;

int trinumber = input % 2 == 0 ? (input / 2) -1: (input - 1) / 2;
int s = input % 2 == 0 ? 2: 1;
string firstrow(input, '*');

cout << firstrow << endl;

while(trinumber>0){
string space(s, ' ');
string astrisk(trinumber, '*');
cout << astrisk << space << astrisk << endl;
s+=2;
--trinumber;
}
cout << firstrow <<endl;

return 0;
}
I don't think there's something to simplify here.
If you don't like the ?: operator it could be replaced with

int s = 2 - input%2;
int trinumber = (input-s)/2;

Other than that I'd just complicate the code by replacing cout << string(len, 'symbol'); with for(int i = 0; i < len; i++) cout.put('symbol');

By the way, if you're looking for practice projects, take a look here : http://www.cplusplus.com/forum/articles/12974/
Sweet, thanks heaps.
Thanks for the help and also the link!
Topic archived. No new replies allowed.