当前位置:网站首页>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 ~
边栏推荐
- Advantages of using net core / why
- Circulating tumor cells - here comes abnova's solution
- Composition API premise
- Asynchronous components and suspend (in real development)
- $refs: get the element object or sub component instance in the component:
- Procedure in PostgreSQL supports transaction syntax (instance & Analysis)
- How DHCP router works
- Detailed explanation of transform origin attribute
- FPGA course: application scenario of jesd204b (dry goods sharing)
- 组件的通信
猜你喜欢

Apache AB stress test

Circulating tumor cells - here comes abnova's solution

Basic process of network transmission using tcp/ip four layer model

子组件传递给父组件

Role of virtual machine

jdbc数据库连接池使用问题

Reflection (II)

Lvs+kept (DR mode) learning notes

Jetpack compose is much more than a UI framework~

At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
随机推荐
From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
How DHCP router works
Modify the jupyter notebook file path
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
Several important steps to light up the display
大咖云集|NextArch基金会云开发Meetup来啦
PostgreSQL source code (60) transaction system summary
Asynchronous components and suspend (in real development)
Software acceptance test
Reflection (II)
Abnova membrane protein lipoprotein technology and category display
Basic process of network transmission using tcp/ip four layer model
Paranoid unqualified company
Academic report series (VI) - autonomous driving on the journey to full autonomy
弹性布局(二)
How to model and simulate the target robot [mathematical / control significance]
MySQL service is missing from computer service
main函数在import语句中的特殊行为
Databinding exception of kotlin
Tumor immunotherapy research prosci Lag3 antibody solution