All pastes #8927 Raw Edit

Miscellany

public text v1 · immutable
#8927 ·published 2005-04-06 13:59 UTC
rendered paste body
int flipdigits(int i) //Here we flip em, but I can't figure out a gracefull way to do the kine without if statements.
{ 
	stack<char> s; 
	while(i) { s.push(i%10); i/=10; } 
	int d=1; 
	while(s.size()) 
	{ 
		i+=d*s.top(); 
		s.pop(); 
		d*=10; 
	} 
	return i; 
}