
Program :
#include <iostream>
#include <string>
#include <stack>
#include <vector>
using namespace std;
int main() {
std::string common;
std::vector<std::string> vs1 = {"seventeen","fourteen","fiftyfour","fiftysix","ten","eleven","twelve"}; //vector
std::vector<std::string> vs2 = {"thirteen","nine","ten","eleven","twelve"};
std::vector<std::string> dest;
for(int i=0;i<vs1.size();i++)
{
for(int j=0;j<vs2.size();j++)
{
if((vs1[i].compare(vs2[j])) == 0) //comparing vs1 and vs2
{
dest.push_back(vs1[i]); //if found pushing it to dest vector
}
}
}
if(dest.size() > 0)
common = dest[0]; //assigning dest[0] to common
std::cout<<"\n"<<common<<"\n";
}

Output:

please solve it in a clear way by putting directly a screenshot of the code on...
C++ SECTION 1) (15 points) Write a full C++ program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Ex: If the input is: 4 hello zoo sleep drizzle z then the output is: 200 drizzle To...
C++ Language:
TestCase:
Write a function, called "sort Lbefore e that can sort words into whether or not they conform to the 1 beforee, except after c rule, See htrps//en.oxtorddictionaries.com/spelling/-before-e-except-after-cl. This function takes 4 references to vectors of strings as parameters . The first vector is the input consisting of lowercase words (only alphabetic charactersl. The next vector should be filled with words that follow the rule The next vector should be filled with words that don't have ie or...
C++ Language, Only the sort_i_before_e func, not included main.
Also, plz look at the instructions. use vector.
Write a function, called "sort Lbefore e that can sort words into whether or not they conform to the 1 beforee, except after c rule, See htrps//en.oxtorddictionaries.com/spelling/-before-e-except-after-cl. This function takes 4 references to vectors of strings as parameters . The first vector is the input consisting of lowercase words (only alphabetic charactersl. The next vector should be filled with words that follow the...
Need help with this Home wrok question pls.
For this exercise you will write code or verifying usernames against a list of existing usernames. This task is known as whitelisting. It is also used as part of spam filters: spam filters that come with email clients have both whitelists and blacklists of senders and keywords to look for in emails. You are given a list of usernames that are trying to get access to a system and you need to...
Hello, so I'm trying to write a program that takes time input as integer and returns them in strings. I have most of it working and I just need to write string values for 31~60. Is there a way to write a statement so if input is 31 or greater, subtract from 60 and return minutes + "before" + hour? Rather than writing 30 more lines for 31-60. import java.util.Scanner; public class TimeName { //Main method acquires user input...
A contact list is a place where you can store a specific contact with other associated information such as a phone number, email address, birthday, etc. Write a program that first takes as input an integer N that represents the number of word pairs in the list to follow. Word pairs consist of a name and a phone number (both strings). That list is followed by a name, and your program should output the phone number associated with that name....
Can you please translate this code from Java to C++;
These are the only libraries i am allowed to use
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <string>
using namespace std;
1 /* Given a string, compute recursively (no loops) a new string where all * appearances of "pi" have been replaced by "3.14". public String changepi(String str) { if(str.length() <= 1) return str; if(str.substring(0, 2).equals("pi")) return "3.14" + changepi(str.substring(2)); 11 12 return str.charAt(0) + changepi(str.substring(1)); }
I was wondering how to do the following. This will all be in a header file to be called in a .cpp file. They all have to be template functions because the .cpp file will test a few different values for each function. This should be done in C++ ====== Write a variadic template for a function named problem5 that joins an arbitrary number of strings together. This function will serve as the terminating case for two strings and your...
Problem Statement This problem provides you with a linked list composed of node objects chained together via node pointers. Each node has a next pointer which points to the next node in the chain. The last node is identified by having a NULL (or nullptr) next pointer. The linked lists for this problem store string data. Your task: identify the longest string stored in the linked list. If two strings are of the same length, return the string that occurred...
Hello can anyone help solve this please in Python the way it's
asked?
Question 22 40 pts List Comprehensions Write the solution to a file named p2.py and upload it here. Comprehensions will show up at the midterm exam, so it's important to practice. a) Write a list comprehension that returns a list [0, 1,4, 9, 16, .. 625] starting from range(0, 26). (lots of list elements were omitted in ...) b) Write a list comprehension that returns the list...