[ create a new paste ] login | about

Link: http://codepad.org/siYYc9Yc    [ raw code | output | fork ]

C++, pasted on Jul 13:
#include <iostream>

int main()
{
	int a{ 0 }; // hang doc
	int b{ 0 }; // hang ngang

	while (a < 5)
	{
		b = 1;
		a++;
	
		while (b <= a)
		{
			std::cout << b << " ";
			b++;
		}

		std::cout << std::endl;
	}

	system("pause");
	return 0;
}


Output:
1
2
3
In function 'int main()':
Line 5: error: a function-definition is not allowed here before '{' token
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: