生日蜡烛 |
您所在的位置:网站首页 › 电子生日蜡烛小程序 › 生日蜡烛 |
生日蜡烛 某君从某年开始每年都举办一次生日party,并且每次都要吹熄与年龄相同根数的蜡烛。 现在算起来,他一共吹熄了236根蜡烛。 请问,他从多少岁开始过生日party的? 请填写他开始过生日party的年龄数。 注意:你提交的应该是一个整数,不要填写任何多余的内容或说明性文字。 答案:26 #include using namespace std; int Judge(int x) { int h=x,sum=0; while(sum!=236&&sum236) return 0; } int main() { int b=0; for(int a=1;b==0;a++) { b=Judge(a); if(b!=0) { printf("%d\n",b); } } return 0; } |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |