What do you want to save?
Add Code snippet
New code examples
-
C++ 2022-02-16 06:15:25
divide two polynomials c++
#include <iostream>#include <iterator>#include <vector> using namespace std;typedef vector<double> Poly; // does: prints all members of vector// input: c - ASCII char with the name of the vector// A - refere... Add solution -
C++ 2022-02-02 20:41:55
sort vector in descending order
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> v = { 10, 9, 8, 6, 7, 2, 5, 1 }; sort(v.begin(), v.end(), greater <>()); } Add solution -
C++ 2022-01-31 21:17:58
how to delete an element in vector pair in cpp
#include <iostream> #include <utility> #include <vector> using namespace std; int main() { vector< pair<int, int> > v; int N = 5; const int threshold = 2; for(int i = 0; i < N; ++i) v.push_back(m... Add solution -
C++ 2021-11-21 15:25:23
c++ vector get first element
// vector::front #include <iostream> #include <vector> int main () { std::vector<int> myvector; myvector.push_back(78); myvector.push_back(16); // now front equals 78, and back 16 int first = myvector.front(); //first = 78... Add solution -
C++ 2021-11-21 01:59:09
stringstream tutorial
#include <iostream> #include <vector> #include <string> #include <sstream> using namespace std; int main() { string str("Hello from the dark side"); string tmp; // A string to store the word on e... Add solution