当前位置:网站首页>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 ~
边栏推荐
- Abnova immunohistochemical service solution
- From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
- $refs: get the element object or sub component instance in the component:
- 父组件传递给子组件:Props
- LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
- Basic process of network transmission using tcp/ip four layer model
- Common function detect_ image/predict
- Abnova circulating tumor DNA whole blood isolation, genomic DNA extraction and analysis
- 大咖云集|NextArch基金会云开发Meetup来啦
- 弹性布局(一)
猜你喜欢
Big coffee gathering | nextarch foundation cloud development meetup is coming
Lm11 reconstruction of K-line and construction of timing trading strategy
.net core 访问不常见的静态文件类型(MIME 类型)
Bindingexception exception (error reporting) processing
Detailed explanation of transform origin attribute
Use of completable future
Precise space-time travel flow regulation system - ultra-high precision positioning system based on UWB
$refs:组件中获取元素对象或者子组件实例:
关于二进制无法精确表示小数
大咖云集|NextArch基金会云开发Meetup来啦
随机推荐
关于数据库数据转移的问题,求各位解答下
MySQL view bin log and recover data
Networkx drawing and common library function coordinate drawing
Multidisciplinary integration
【mysqld】Can't create/write to file
How can clothing stores make profits?
After the promotion, sales volume and flow are both. Is it really easy to relax?
詳解機器翻譯任務中的BLEU
Non empty verification of collection in SQL
SQLMAP使用教程(四)实战技巧三之绕过防火墙
大咖云集|NextArch基金会云开发Meetup来啦
Several important steps to light up the display
关于二进制无法精确表示小数
Basic process of network transmission using tcp/ip four layer model
栈题目:有效括号的嵌套深度
readonly 只读
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
Unity3d learning notes
Tool class: object to map hump to underline underline hump
软件验收测试