当前位置:网站首页>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 ~
边栏推荐
- LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
- Jesd204b clock network
- Role of virtual machine
- Modify the jupyter notebook file path
- 多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
- main函数在import语句中的特殊行为
- Software acceptance test
- Bindingexception exception (error reporting) processing
- Test of transform parameters of impdp
- Stack Title: nesting depth of valid parentheses
猜你喜欢
Communication between non parent and child components
Anr principle and Practice
jdbc数据库连接池使用问题
Freeswitch dials extension number source code tracking
Bindingexception exception (error reporting) processing
虚拟机的作用
Abnova membrane protein lipoprotein technology and category display
How can brand e-commerce grow against the trend? See the future here!
关于二进制无法精确表示小数
JDBC database connection pool usage problem
随机推荐
How can gyms improve their competitiveness?
Torefs API and toref API
How can clothing stores make profits?
点亮显示屏的几个重要步骤
Lm11 reconstruction of K-line and construction of timing trading strategy
Paranoid unqualified company
Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park
How to model and simulate the target robot [mathematical / control significance]
关于数据库数据转移的问题,求各位解答下
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
sql中对集合进行非空校验
Hidden Markov model (HMM) learning notes
詳解機器翻譯任務中的BLEU
. Net core accesses uncommon static file types (MIME types)
Libcurl returns curlcode description
Big coffee gathering | nextarch foundation cloud development meetup is coming
Get the city according to IP
Sword finger offer high quality code
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据
Basic process of network transmission using tcp/ip four layer model