当前位置:网站首页>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 ~
边栏推荐
- Implementation of AVL tree
- 【mysqld】Can't create/write to file
- Exception of DB2 getting table information: caused by: com ibm. db2.jcc. am. SqlException: [jcc][t4][1065][12306][4.25.13]
- Complete process of MySQL SQL
- MySQL service is missing from computer service
- js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
- Libcurl returns curlcode description
- Pass child component to parent component
- [noi simulation] regional division (conclusion, structure)
- .net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context
猜你喜欢
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
Graduation design game mall
Paranoid unqualified company
Flexible layout (I)
Sqlmap tutorial (IV) practical skills three: bypass the firewall
Anr principle and Practice
After the promotion, sales volume and flow are both. Is it really easy to relax?
Kuboard无法发送邮件和钉钉告警问题解决
Jesd204b clock network
Detailed explanation of transform origin attribute
随机推荐
【mysqld】Can't create/write to file
How can flinksql calculate the difference between a field before and after update when docking with CDC?
Pass child component to parent component
子组件传递给父组件
Unity3d learning notes
【JDBC以及内部类的讲解】
计算机服务中缺失MySQL服务
软件验收测试
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
How to share the same storage among multiple kubernetes clusters
Please ask a question, flick Oracle CDC, read a table without update operation, and repeatedly read the full amount of data every ten seconds
Détailler le bleu dans les tâches de traduction automatique
修改Jupyter Notebook文件路径
Readonly read only
MySQL binlog related commands
Sqlmap tutorial (IV) practical skills three: bypass the firewall
oracle如何备份索引
Matlab tips (29) polynomial fitting plotfit
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告