当前位置:网站首页>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 ~
边栏推荐
- Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
- Graduation design game mall
- freeswitch拨打分机号源代码跟踪
- Libcurl returns curlcode description
- CompletableFuture使用详解
- Kuboard can't send email and nail alarm problem is solved
- Software acceptance test
- Config distributed configuration center
- Sqlmap tutorial (IV) practical skills three: bypass the firewall
- Torefs API and toref API
猜你喜欢

Detailed explanation of transform origin attribute

From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype

Matlab tips (29) polynomial fitting plotfit

. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context

Introduction to abnova's in vitro mRNA transcription workflow and capping method

.net core 访问不常见的静态文件类型(MIME 类型)

The currently released SKU (sales specification) information contains words that are suspected to have nothing to do with baby

MySQL view bin log and recover data
![How to model and simulate the target robot [mathematical / control significance]](/img/bd/79f6338751b6773859435c54430ec3.png)
How to model and simulate the target robot [mathematical / control significance]

How can brand e-commerce grow against the trend? See the future here!
随机推荐
How Oracle backs up indexes
The startup of MySQL installed in RPM mode of Linux system failed
组件的通信
Networkx drawing and common library function coordinate drawing
软件验收测试
Kuboard无法发送邮件和钉钉告警问题解决
Tujia, muniao, meituan... Home stay summer war will start
Initial experience of addresssanitizer Technology
PostgreSQL source code (60) transaction system summary
How to do sports training in venues?
Advantages of using net core / why
CompletableFuture使用详解
Can 7-day zero foundation prove HCIA? Huawei certification system learning path sharing
From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
. Net core accesses uncommon static file types (MIME types)
计算机服务中缺失MySQL服务
子组件传递给父组件
Explain Bleu in machine translation task in detail
非父子组件的通信
oracle如何备份索引