当前位置:网站首页>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 ~
边栏推荐
- toRefs API 与 toRef Api
- Project practice five fitting straight lines to obtain the center line
- Procedure in PostgreSQL supports transaction syntax (instance & Analysis)
- Big coffee gathering | nextarch foundation cloud development meetup is coming
- $parent(获取父组件) 和 $root(获取根组件)
- 组件的通信
- Explain Bleu in machine translation task in detail
- Select the product attribute pop-up box to pop up the animation effect from the bottom
- 多线程与高并发(9)——AQS其他同步组件(Semaphore、ReentrantReadWriteLock、Exchanger)
- Role of virtual machine
猜你喜欢

$refs: get the element object or sub component instance in the component:

Network foundation - header, encapsulation and unpacking

IP address

Jetpack compose is much more than a UI framework~

Communication between non parent and child components

transform-origin属性详解

計算機服務中缺失MySQL服務

Implementation of AVL tree

Brand · consultation standardization

Complete process of MySQL SQL
随机推荐
PostgreSQL source code (60) transaction system summary
Please ask a question, flick Oracle CDC, read a table without update operation, and repeatedly read the full amount of data every ten seconds
Matlab tips (29) polynomial fitting plotfit
抽絲剝繭C語言(高階)指針的進階
Reflection (II)
2018 Jiangsu Vocational College skills competition vocational group "information security management and evaluation" competition assignment
Le Service MySQL manque dans le service informatique
How can clothing stores make profits?
Unity C function notes
Bindingexception exception (error reporting) processing
Algorithm --- bit count (kotlin)
How can brand e-commerce grow against the trend? See the future here!
Graduation design game mall
readonly 只读
Modify the jupyter notebook file path
Mobx knowledge point collection case (quick start)
Procedure in PostgreSQL supports transaction syntax (instance & Analysis)
MySQL user permissions
Docker compose start redis cluster
Brand · consultation standardization