#include <iostream>

const int nMax = 10;

int main( )
{
	bool bSitch = true;
	int sum = 1;

	for( int i=2 ; i<=nMax ; ++i )
	{
		if( bSitch == true )
		{
			sum += i;
		}
		else
		{
			sum -= i;
		}
		bSitch = !bSitch;
	}

	printf( "%d\n", sum );

	return 0;
}

+ Recent posts