当前位置:网站首页>Exercise 10-1 judge the three digits that meet the conditions
Exercise 10-1 judge the three digits that meet the conditions
2022-07-03 14:09:00 【ᯤ⁹ᴳ⁺ ·】
exercises 10-1 Judge the three digits that meet the conditions (15 branch )
This question requests to realize a function , Count the complete square number with the same two digits in the three digits in a given interval ( Such as 144、676) The number of .
Function interface definition :
int search( int n );
Parameters passed in int n Is a three digit positive integer ( Highest digit non 0). function search return [101, n] The number of all the numbers that satisfy the conditions in the interval .
Sample referee test procedure :
#include <stdio.h>
#include <math.h>
int search( int n );
int main()
{
int number;
scanf("%d",&number);
printf("count=%d\n",search(number));
return 0;
}
/* Your code will be embedded here */
sample input :
500
sample output :
count=6
int search( int n ){
int count=0,m,x,a,b,c;
for(m=11;m*m<=n;m++){
x=m*m;
a=x%10;
b=x/10%10;
c=x/100;
if(a==b||a==c||b==c){
count++;
}
}
return count;
}
边栏推荐
- The small project (servlet+jsp+mysql+el+jstl) completes a servlet with login function, with the operation of adding, deleting, modifying and querying. Realize login authentication, prevent illegal log
- JS general form submission 1-onsubmit
- Implementation of Muduo accept connection, disconnection and sending data
- Reflection -- basic usage
- concat和concat_ws()区别及group_concat()和repeat()函数的使用
- JS new challenges
- JS input number and standard digit number are compared. The problem of adding 0 to 0
- Redis: redis data structure and key operation commands
- 好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
- How to bold text in AI
猜你喜欢

Nucleic acid modified metal organic framework drug carrier | pcn-223 metal organic framework encapsulated ad adamantane | zif-8 encapsulated adriamycin (DOX)

concat和concat_ws()区别及group_concat()和repeat()函数的使用

Generate directories from web content

Qt学习22 布局管理器(一)

QT learning 23 layout manager (II)

Fabric. JS document

Redis: operation command of string type data

28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;

Example analysis of QT learning 18 login dialog box

Vite project commissioning
随机推荐
js . Find the first palindrome string in the array
Installation impression notes
Another industry has been broken by Chinese chips. No wonder the leading analog chip companies in the United States have cut prices and sold off
Go 1.16.4: manage third-party libraries with Mod
关于回溯问题中的排列问题的思考(LeetCode46题与47题)
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
好看、好用、强大的手写笔记软件综合评测:Notability、GoodNotes、MarginNote、随手写、Notes Writers、CollaNote、CollaNote、Prodrafts、Noteshelf、FlowUs、OneNote、苹果备忘录
Go language web development series 26: Gin framework: demonstrates the execution sequence of code when there are multiple middleware
How to promote the progress of project collaboration | community essay solicitation
Implementation of Muduo asynchronous logging
Qt学习19 Qt 中的标准对话框(上)
Dynamic programming 01 knapsack and complete knapsack
JS Part 2
金属有机骨架(MOFs)抗肿瘤药载体|PCN-223装载甲硝唑|UiO-66包载盐酸环丙沙星([email protected])
Vite project commissioning
FPGA test method takes mentor tool as an example
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
Go language unit test 5: go language uses go sqlmock and Gorm to do database query mock
Go language web development series 29: Gin framework uses gin contrib / sessions library to manage sessions (based on cookies)
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。