当前位置:网站首页>Blue Bridge Cup Birthday candles (violence)
Blue Bridge Cup Birthday candles (violence)
2022-07-07 07:17:00 【Woodenman Du】
Question:
Title Description
This question is to fill in the blanks , Just calculate the result , Use the output statement in the code to output the filled results .
From a certain year on, you hold a birthday every year party, And blow out the same number of candles with the same age every time .
Now count , He blew it out altogether 236 A candle .
Excuse me, , How old was his birthday party Of ?
Please output his birthday party The age of .
Operation limit
- Maximum operation time :1s
- Maximum running memory : 128M
Result:26
Code:
#include <iostream>
using namespace std;
int main()
{
// There should be nothing to explain , Just try it with direct violence
for(int i = 1; i < 100; i++){
int sum = 0; // initialization
for(int j = i; j < 100; j++){
sum += j;
if(sum == 236) { cout <<i; return 0; }
if(sum > 236) break; // More than the , direct break
}
}
return 0;
}
// In fact, the purpose of writing notes is to make up the number of words
Statement : For the purpose of sorting out personal questions , In case of infringement , Please contact to delete ~
边栏推荐
- [noi simulation] regional division (conclusion, structure)
- 计算机服务中缺失MySQL服务
- Learning records on July 4, 2022
- Non empty verification of collection in SQL
- About binary cannot express decimals accurately
- js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
- readonly 只读
- 异步组件和Suspense(真实开发中)
- JDBC database connection pool usage problem
- Multidisciplinary integration
猜你喜欢
$refs: get the element object or sub component instance in the component:
Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park
Prime partner of Huawei machine test questions
异步组件和Suspense(真实开发中)
How can brand e-commerce grow against the trend? See the future here!
Abnova membrane protein lipoprotein technology and category display
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
关于二进制无法精确表示小数
.net core 访问不常见的静态文件类型(MIME 类型)
transform-origin属性详解
随机推荐
How does an enterprise manage data? Share the experience summary of four aspects of data governance
jdbc数据库连接池使用问题
FullGC问题分析及解决办法总结
Esxi attaching mobile (Mechanical) hard disk detailed tutorial
sql中对集合进行非空校验
$refs:组件中获取元素对象或者子组件实例:
Communication of components
请教一下,监听pgsql ,怎样可以监听多个schema和table
Basic introduction of JWT
$parent (get parent component) and $root (get root component)
详解机器翻译任务中的BLEU
Multidisciplinary integration
Bindingexception exception (error reporting) processing
Pass child component to parent component
Freeswitch dials extension number source code tracking
Introduction to abnova's in vitro mRNA transcription workflow and capping method
linux系统rpm方式安装的mysql启动失败
After the promotion, sales volume and flow are both. Is it really easy to relax?
Kuboard can't send email and nail alarm problem is solved
Apache AB stress test