当前位置:网站首页>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));
}边栏推荐
- Access control system based on RFID
- Understanding of closures
- 求解一维数组前缀和
- 插入排序
- Lintcode:127. Topology sorting
- Market trend report, technical innovation and market forecast of hydraulic chain hoist in China
- Before job hopping, Jin San made up the interview questions. Jin San successfully landed at Tencent and got a 30K test offer
- Delphi XE7的蓝牙 Bluetooth
- CUDA out of memory
- EDI 855 purchase order confirmation
猜你喜欢
随机推荐
torch. Finfo function
test
Social metauniverse: start from redefining yourself
Before job hopping, Jin San made up the interview questions. Jin San successfully landed at Tencent and got a 30K test offer
同花顺能开户吗,在同花顺开户安全么
Composer version degradation
leetcode:210. 课程表 II
leetcode:207. Class Schedule Card
China hydraulic cylinder linear position sensor market trend report, technical dynamic innovation and market forecast
leetcode:210. Schedule II
#141 Linked List Cycle
GPU giant NVIDIA suffered a "devastating" network attack, and the number one malware shut down its botnet infrastructure | global network security hotspot on February 28
在同花顺开户安全么,买股票怎么网上开户
Let Google browser fofa plug-in come alive
Leetcode: 210. Programme II
Do we media video, and share the necessary app for friendly new media operation
[tutorial] Firefox send: deployment method of Firefox open source temporary file sharing service platform
Research Report on market supply and demand and strategy of China's hydraulic hammer industry
Typescript definition type: type 'timeout' cannot be assigned to type 'number';
Algorinote_2_主定理与 Akra-Bazzi 定理








