当前位置:网站首页>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 ~
边栏推荐
- Esxi attaching mobile (Mechanical) hard disk detailed tutorial
- Select the product attribute pop-up box to pop up the animation effect from the bottom
- Abnova membrane protein lipoprotein technology and category display
- The startup of MySQL installed in RPM mode of Linux system failed
- Composition API 前提
- Matlab tips (29) polynomial fitting plotfit
- Nesting and splitting of components
- main函数在import语句中的特殊行为
- 子组件传递给父组件
- JS small exercise
猜你喜欢

Flexible layout (II)

Paranoid unqualified company
![[noi simulation] regional division (conclusion, structure)](/img/7d/4c66cd0a30e52ccd167b6138fcb4df.png)
[noi simulation] regional division (conclusion, structure)

Matlab tips (30) nonlinear fitting lsqcurefit

jdbc数据库连接池使用问题

Matlab tips (29) polynomial fitting plotfit

Release notes of JMeter version 5.5

LC 面试题 02.07. 链表相交 & LC142. 环形链表II

CompletableFuture使用详解

关于二进制无法精确表示小数
随机推荐
多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
Torefs API and toref API
from . onnxruntime_ pybind11_ State Import * noqa ddddocr operation error
子组件传递给父组件
How to do sports training in venues?
【JDBC以及内部类的讲解】
Composition API 前提
Flexible layout (II)
父组件传递给子组件:Props
Modify the jupyter notebook file path
Sqlmap tutorial (IV) practical skills three: bypass the firewall
Jesd204b clock network
Leetcode t1165: log analysis
Role of virtual machine
Master-slave replication principle of MySQL
Non empty verification of collection in SQL
main函数在import语句中的特殊行为
Lm11 reconstruction of K-line and construction of timing trading strategy
How does an enterprise manage data? Share the experience summary of four aspects of data governance
请教一个问题,flink oracle cdc,读取一个没有更新操作的表,隔十几秒就重复读取全量数据