当前位置:网站首页>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 ~
边栏推荐
猜你喜欢

抽丝剥茧C语言(高阶)指针的进阶

Please answer the questions about database data transfer

SQLMAP使用教程(四)实战技巧三之绕过防火墙

Apache AB stress test

LC 面试题 02.07. 链表相交 & LC142. 环形链表II

Detailed explanation of transform origin attribute

The currently released SKU (sales specification) information contains words that are suspected to have nothing to do with baby

Circulating tumor cells - here comes abnova's solution

How can clothing stores make profits?

At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
随机推荐
Composition API premise
Four goals for the construction of intelligent safety risk management and control platform for hazardous chemical enterprises in Chemical Industry Park
Reflection (II)
Bus message bus
main函数在import语句中的特殊行为
js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
PostgreSQL source code (59) analysis of transaction ID allocation and overflow judgment methods
At the age of 20, I got the ByteDance offer on four sides, and I still can't believe it
Abnova membrane protein lipoprotein technology and category display
mips uclibc 交叉编译ffmpeg,支持 G711A 编解码
关于二进制无法精确表示小数
Special behavior of main function in import statement
[noi simulation] regional division (conclusion, structure)
Torefs API and toref API
Algorithm --- bit count (kotlin)
Please tell me how to monitor multiple schemas and tables by listening to PgSQL
leetcode 509. Fibonacci number
Asynchronous components and suspend (in real development)
Readonly read only
Pass child component to parent component