当前位置:网站首页>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 ~
边栏推荐
- At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
- MySQL view bin log and recover data
- Lm11 reconstruction of K-line and construction of timing trading strategy
- PostgreSQL source code (59) analysis of transaction ID allocation and overflow judgment methods
- MySQL binlog related commands
- How can gyms improve their competitiveness?
- Stack Title: nesting depth of valid parentheses
- L'étape avancée du pointeur de langage C (haut de gamme) pour l'enroulement des cocons
- Matlab tips (29) polynomial fitting plotfit
- 詳解機器翻譯任務中的BLEU
猜你喜欢
随机推荐
组件的通信
Jesd204b clock network
虚拟机的作用
MySQL user permissions
异步组件和Suspense(真实开发中)
Advanced level of C language (high level) pointer
How can gyms improve their competitiveness?
Brand · consultation standardization
计算机服务中缺失MySQL服务
1089: highest order of factorial
How can clothing stores make profits?
Please answer the questions about database data transfer
栈题目:有效括号的嵌套深度
Composition API 前提
Docker compose start redis cluster
Project practice five fitting straight lines to obtain the center line
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
How DHCP router works
组件的嵌套和拆分









