当前位置:网站首页>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 ~
边栏推荐
- Causes and solutions of oom (memory overflow)
- 子组件传递给父组件
- Tumor immunotherapy research prosci Lag3 antibody solution
- Asynchronous components and suspend (in real development)
- PostgreSQL source code (59) analysis of transaction ID allocation and overflow judgment methods
- Initial experience of addresssanitizer Technology
- Detailed explanation of transform origin attribute
- Flexible layout (II)
- Stack Title: nesting depth of valid parentheses
- Libcurl returns curlcode description
猜你喜欢
How can clothing stores make profits?
Brand · consultation standardization
Detailed explanation of transform origin attribute
Project practice five fitting straight lines to obtain the center line
Bindingexception exception (error reporting) processing
Paranoid unqualified company
Abnova circulating tumor DNA whole blood isolation, genomic DNA extraction and analysis
計算機服務中缺失MySQL服務
About binary cannot express decimals accurately
Complete process of MySQL SQL
随机推荐
Leetcode t1165: log analysis
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
How can brand e-commerce grow against the trend? See the future here!
Introduction to abnova's in vitro mRNA transcription workflow and capping method
1089: highest order of factorial
How to do sports training in venues?
How can flinksql calculate the difference between a field before and after update when docking with CDC?
Communication between non parent and child components
計算機服務中缺失MySQL服務
Sqlmap tutorial (IV) practical skills three: bypass the firewall
Tumor immunotherapy research prosci Lag3 antibody solution
组件的通信
【mysqld】Can't create/write to file
Circulating tumor cells - here comes abnova's solution
Le Service MySQL manque dans le service informatique
Software acceptance test
Precise space-time travel flow regulation system - ultra-high precision positioning system based on UWB
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
. Net core accesses uncommon static file types (MIME types)