What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-25 04:00:07
loop through set c++
// set::begin/end #include <iostream> #include <set> int main () { int myints[] = {75,23,65,42,13}; std::set<int> myset (myints,myints+5); std::cout << "myset contains:"; for (std::set<int>::iterator it=my... Add solution -
C++ 2022-02-24 22:15:12
count the occurrences ofanagram
//this solution is for when both the string have same type of character //example: aabaabaa and aaba #include <bits/stdc++.h> using namespace std; int main() { string s,ptr; cout<<"Enter the first string:"<<endl; ... Add solution -
C++ 2022-02-24 21:15:04
sliding window maximum sum subarray
#include <bits/stdc++.h> using namespace std; int main() { int n; cout<<"enter the size of the array:"<<endl; cin>>n; int arr[n]; cout<<"Enter the elements of the array:"<<endl;... Add solution -
C++ 2022-02-24 11:00:27
get index of value c++
vector<int> arr = { 6, 3, 5, 2, 8 }; vector<int>::iterator itr = std::find(arr.begin(), arr.end(), elem); if (itr != end(arr)) { cout << "Element " << elem << " is present at index " << distance(ar... Add solution -
C++ 2022-02-23 04:00:07
pure virtual function in c++
#include <iostream> #include <string> //Pure virtual function or inteface allows us to define a function in a base class that doesn't have an implementation or definition in the base class and force sub classes to implement that function //P... Add solution