~cpp
#include <stdio.h> 

main() 
{ 
	int n,sum;
	sum=0;
	n=1;

	while (sum<=3000)
	{
		sum=sum+n;
		n=n+1;
	}	
printf("n=%d,sum%d\n",n,sum);
	
	
} 
 
Retrieved from http://wiki.zeropage.org/wiki.php/최소정수의합/이재경
last modified 2021-02-07 05:31:17