All pastes #592533 Raw Edit

Unnamed

public cpp v1 · immutable
#592533 ·published 2007-06-27 20:21 UTC
rendered paste body
Instructions:	Create a triangle from the top down, putting an equal amount of space on each side of the dollar signs.	With 1 dollar sign on the first line, 3 dollar signs on the second, and 5 on the third.DIAGRAM:	(spaces / 2) (dollars) (spaces / 2)CODE:	for (dollars = 1, spaces = 4, counter = 0; counter < 3; dollars += 2, spaces -= 2, counter++) {		for (i = 0; i < (spaces / 2); i++) {			cout << " ";		}				for (i = 0; i < dollars; i++) {			cout << "$";		}				for (i = 0; i < (spaces / 2); i++) {			cout << " ";		}				cout << endl;	}