当前位置:网站首页>Blue Bridge Cup Netizen age (violence)
Blue Bridge Cup Netizen age (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 .
Some Junxin knows a netizen . When asked about age , His netizens said : “ My age is a 22 digit , I'm older than my son 2727 year , If I swap the two digits of my age , It's exactly the age of my son ”
Please calculate : How many possibilities are there for the age of netizens ?
Tips :3030 Age is one of the possibilities .
Operation limit
- Maximum operation time :1s
- Maximum running memory : 128M
Result: 7
Solve: Direct violence . There's nothing particular about , There is no need to spend time on optimization .
Code:
#include <iostream>
using namespace std;
int main()
{
int cnt = 0;
for(int i = 28; i <98; i++)
{
int temp = i,ans = 0;
while(temp){
ans *= 10;
ans += temp%10;
temp /= 10;
}
if(i - ans == 27) cnt++;
}
cout <<cnt;
return 0;
}
Statement : For the purpose of sorting out personal questions , In case of infringement , Please contact to delete ~
边栏推荐
- 虚拟机的作用
- Implementation of AVL tree
- Introduction to abnova's in vitro mRNA transcription workflow and capping method
- Causes and solutions of oom (memory overflow)
- LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
- PostgreSQL source code (59) analysis of transaction ID allocation and overflow judgment methods
- Complete process of MySQL SQL
- MIPS uclibc cross compile ffmpeg, support g711a encoding and decoding
- Please ask a question, flick Oracle CDC, read a table without update operation, and repeatedly read the full amount of data every ten seconds
- Multidisciplinary integration
猜你喜欢
Paranoid unqualified company
弹性布局(二)
Big coffee gathering | nextarch foundation cloud development meetup is coming
main函数在import语句中的特殊行为
計算機服務中缺失MySQL服務
Unity3d learning notes
$parent (get parent component) and $root (get root component)
How to share the same storage among multiple kubernetes clusters
Pass child component to parent component
FPGA course: application scenario of jesd204b (dry goods sharing)
随机推荐
ViewModelProvider. Of obsolete solution
Lm11 reconstruction of K-line and construction of timing trading strategy
Circulating tumor cells - here comes abnova's solution
Hidden Markov model (HMM) learning notes
How can clothing stores make profits?
How can gyms improve their competitiveness?
How can brand e-commerce grow against the trend? See the future here!
The startup of MySQL installed in RPM mode of Linux system failed
Prime partner of Huawei machine test questions
Get the city according to IP
Initial experience of addresssanitizer Technology
Kuboard can't send email and nail alarm problem is solved
MySQL binlog related commands
Bus message bus
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
点亮显示屏的几个重要步骤
Apache AB stress test
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
How can flinksql calculate the difference between a field before and after update when docking with CDC?
Non empty verification of collection in SQL