#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int sum=0, num=0;
while(1)
{
sum=sum+num;
printf("num : %d sum : %d\n",num, sum);
if(sum>5000)
break;
num++;
}
printf("sum: %d \n", sum);
printf("num: %d \n", num);
system("pause");
return 0;
}