Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Good pairs
#include <bits/stdc++.h> using namespace std; int main() { int numsSize; cout<<"Enter the total size in nums:"<<endl; cin>>numsSize; int nums[numsSize]; for(int k=0;k<numsSize;k++) {cin>>nums[k];} int i,j,count=0; for(i=0;i<numsSize;i++) { for(j=0;j<numsSize;j++) { if(nums[i]==nums[j] and i<j) {count=count+1;} } } cout<<"Good pairs is: "<<count; return 0; }
run
|
edit
|
history
|
help
1
Please
log in
to post a comment.
ContainerVector2
Web Browser History - DLL
Hello World
spiral traversal of a matrix
NonparaSign
Subarray with 0 sum
Depth of Bin tree
Lockable static queue
Using c++11 range-base for loop
cppPyAbs
Please log in to post a comment.