生日蜡烛
某君从某年开始每年都举办一次生日party,并且每次都要吹熄与年龄相同根数的蜡烛。
现在算起来,他一共吹熄了236根蜡烛。
请问,他从多少岁开始过生日party的?
请填写他开始过生日party的年龄数。
开始过生日26 现在岁数33
#include<iostream>
using namespace std;
int main()
{int sum=0;for(int i=1;i<200;i++){sum=0;for(int j=i;j<=200;j++){sum+=j;if(sum==236){cout<<i<<" "<<j<<endl;break;}}}return 0;
}