当前位置:网站首页>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 ~
边栏推荐
- Several important steps to light up the display
- Sword finger offer high quality code
- Special behavior of main function in import statement
- Network foundation - header, encapsulation and unpacking
- Fullgc problem analysis and solution summary
- Matlab tips (29) polynomial fitting plotfit
- Project practice five fitting straight lines to obtain the center line
- Tujia, muniao, meituan... Home stay summer war will start
- FullGC问题分析及解决办法总结
- FPGA course: application scenario of jesd204b (dry goods sharing)
猜你喜欢
Brand · consultation standardization
Apache AB stress test
$refs: get the element object or sub component instance in the component:
Pass parent component to child component: props
From zero to one, I will teach you to build the "clip search by text" search service (2): 5 minutes to realize the prototype
Lvs+kept (DR mode) learning notes
Leetcode t1165: log analysis
"Xiaodeng in operation and maintenance" meets the compliance requirements of gdpr
Config distributed configuration center
抽丝剥茧C语言(高阶)指针进阶练习
随机推荐
Multithreading and high concurrency (9) -- other synchronization components of AQS (semaphore, reentrantreadwritelock, exchanger)
Learning records on July 4, 2022
js小练习
[noi simulation] regional division (conclusion, structure)
[Luogu p1971] rabbit and egg game (bipartite game)
Complete process of MySQL SQL
Fullgc problem analysis and solution summary
Sqlserver multithreaded query problem
Networkx drawing and common library function coordinate drawing
Le Service MySQL manque dans le service informatique
Test of transform parameters of impdp
Stack Title: nesting depth of valid parentheses
关于二进制无法精确表示小数
Matlab tips (30) nonlinear fitting lsqcurefit
計算機服務中缺失MySQL服務
Flexible layout (II)
Détailler le bleu dans les tâches de traduction automatique
FPGA course: application scenario of jesd204b (dry goods sharing)
1089: highest order of factorial
Apache AB stress test