当前位置:网站首页>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 ~
边栏推荐
- Complete process of MySQL SQL
- $parent(获取父组件) 和 $root(获取根组件)
- Modify the jupyter notebook file path
- Test of transform parameters of impdp
- Apache AB stress test
- .net core 访问不常见的静态文件类型(MIME 类型)
- transform-origin属性详解
- Get the city according to IP
- How to model and simulate the target robot [mathematical / control significance]
- Algorithm --- bit count (kotlin)
猜你喜欢
How can clothing stores make profits?
组件的嵌套和拆分
LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
Config distributed configuration center
.net core 访问不常见的静态文件类型(MIME 类型)
$refs:组件中获取元素对象或者子组件实例:
Flexible layout (I)
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
. Net 5 fluentftp connection FTP failure problem: this operation is only allowed using a successfully authenticated context
How to model and simulate the target robot [mathematical / control significance]
随机推荐
.net 5 FluentFTP连接FTP失败问题:This operation is only allowed using a successfully authenticated context
$refs:组件中获取元素对象或者子组件实例:
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
Flexible layout (II)
Leetcode t1165: log analysis
js小练习
Pass parent component to child component: props
LC interview question 02.07 Linked list intersection & lc142 Circular linked list II
Nesting and splitting of components
Advanced level of C language (high level) pointer
Hidden Markov model (HMM) learning notes
Common function detect_ image/predict
软件验收测试
Anr principle and Practice
Master-slave replication principle of MySQL
Unity3d learning notes
详解机器翻译任务中的BLEU
Flexible layout (I)
Abnova immunohistochemical service solution
AVL树的实现