当前位置:网站首页>Solution of good number pairs
Solution of good number pairs
2022-06-12 21:05:00 【Bald and weak】
The question :
Same number right
eg:[1,2,3,1,1,3]
1-1
1-1
3-3
1-1
Output 4 Yes
Code implementation :
#include<stdio.h>
int ArrPairs(int arr[],int len)
{
int count=0;
for(int i=0;i<len;i++)
{
for(int j=i+1;j<len;j++)
{
if(arr[i]==arr[j])
count++;
}
}
return count;
}
int main()
{
int arr[]={1,2,3,1,1,3};
int len=sizeof(arr)/sizeof(arr[0]);
printf("%d",ArrPairs(arr,len));
}边栏推荐
- A blog written clearly by vit
- Research Report on market supply and demand and strategy of China's hydraulic hammer industry
- 多机房动环状态网络触摸屏监控解决方案
- CUDA out of memory
- MySQL field truncation principle and source code analysis
- What did new do
- China hydraulic press market trend report, technical innovation and market forecast
- Bluetooth for Delphi xe7
- SAP WM preliminary transaction code lx29 - list of fixed storage bins
- 做自媒体视频,友好的新媒体运营必备app分享
猜你喜欢

Data visualization - histogram

Data visualization - broken line area chart

ASCII code comparison table

It has been engaged in the functional test of 10K to the test development of 40W annual salary for 5 years, and spent 7 days sorting out the super comprehensive learning route

Lintcode:127. Topology sorting

#141 Linked List Cycle

lintcode:127 · 拓扑排序

Algorinote_2_主定理与 Akra-Bazzi 定理

Data visualization diagram microblog forwarding diagram

#141 Linked List Cycle
随机推荐
#886 Possible Bipartition
To understand Devops, you must read these ten books!
选择排序
leetcode:207. Class Schedule Card
好数对的求解
Introduction to scala basic grammar (III) various operators in Scala
Data visualization - broken line area chart
Integrated monitoring solution for power environment of small and medium-sized computer rooms
#981 Time Based Key-Value Store
做自媒体视频,友好的新媒体运营必备app分享
leetcode:210. Schedule II
Solve the cvxpy error the solver GLPK_ MI is not installed
Let Google browser fofa plug-in come alive
Minio client (MC command) implements data migration
CUDA out of memory
一级指针&二级指针知识点梳理
What did new do
What are the disadvantages of bone conduction earphones? Analysis of advantages and disadvantages of bone conduction earphones
Access control system based on RFID
对闭包的理解