SlideShare a Scribd company logo
Please write a function in C++ that reads from a txt file containing two columns of integers. The
function must find the union and intersection of the two columns. Thank you in advance for your
help. Please write in basic beginner C++ code and include detailed comments so that I can
understand the processes.
Solution
#include
#include
#include
using namespace std;
int main()
{
string name;
cin>>name;
ifstream ins;
ins.open(name);
int a,b;
vector first,second;
while(ins>>a)
{
ins>>b;
first.push_back(a);
second.push_back(b);
}
vector andd,orr;
for(int i=0;i

More Related Content

More from fckindswear

Explain the kinds of information that must be maintained in fixed as.pdf
Explain the kinds of information that must be maintained in fixed as.pdfExplain the kinds of information that must be maintained in fixed as.pdf
Explain the kinds of information that must be maintained in fixed as.pdf
fckindswear
ย 
Dr. P has a culture of stem cells and she wants them to specialize i.pdf
Dr. P has a culture of stem cells and she wants them to specialize i.pdfDr. P has a culture of stem cells and she wants them to specialize i.pdf
Dr. P has a culture of stem cells and she wants them to specialize i.pdf
fckindswear
ย 
Describe two ecological roles of fungi. Related concepts decomposer.pdf
Describe two ecological roles of fungi. Related concepts decomposer.pdfDescribe two ecological roles of fungi. Related concepts decomposer.pdf
Describe two ecological roles of fungi. Related concepts decomposer.pdf
fckindswear
ย 
Differential equations using phase plane analysis. Task 1 (Romeo .pdf
Differential equations using phase plane analysis. Task 1 (Romeo .pdfDifferential equations using phase plane analysis. Task 1 (Romeo .pdf
Differential equations using phase plane analysis. Task 1 (Romeo .pdf
fckindswear
ย 
Develop a stack in c with dynamic memory allocation. Use the followi.pdf
Develop a stack in c with dynamic memory allocation. Use the followi.pdfDevelop a stack in c with dynamic memory allocation. Use the followi.pdf
Develop a stack in c with dynamic memory allocation. Use the followi.pdf
fckindswear
ย 
Define a struct type that represents a smartphone. The struct should.pdf
Define a struct type that represents a smartphone. The struct should.pdfDefine a struct type that represents a smartphone. The struct should.pdf
Define a struct type that represents a smartphone. The struct should.pdf
fckindswear
ย 
Changes in the economy have determined that for the EZ shipping comp.pdf
Changes in the economy have determined that for the EZ shipping comp.pdfChanges in the economy have determined that for the EZ shipping comp.pdf
Changes in the economy have determined that for the EZ shipping comp.pdf
fckindswear
ย 
Broadly speaking, the economy consists of households, firms, governm.pdf
Broadly speaking, the economy consists of households, firms, governm.pdfBroadly speaking, the economy consists of households, firms, governm.pdf
Broadly speaking, the economy consists of households, firms, governm.pdf
fckindswear
ย 
A committee consists of 13 Republicans and 16 Democrats. How many dif.pdf
A committee consists of 13 Republicans and 16 Democrats. How many dif.pdfA committee consists of 13 Republicans and 16 Democrats. How many dif.pdf
A committee consists of 13 Republicans and 16 Democrats. How many dif.pdf
fckindswear
ย 
2. July 01 Record the dividend received from the foreign subsidiary..pdf
2. July 01 Record the dividend received from the foreign subsidiary..pdf2. July 01 Record the dividend received from the foreign subsidiary..pdf
2. July 01 Record the dividend received from the foreign subsidiary..pdf
fckindswear
ย 
You have isolated a new virus, determined it has a lipid envelope,.pdf
You have isolated a new virus, determined it has a lipid envelope,.pdfYou have isolated a new virus, determined it has a lipid envelope,.pdf
You have isolated a new virus, determined it has a lipid envelope,.pdf
fckindswear
ย 
Write the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdfWrite the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdf
fckindswear
ย 
Why is agrobacterium tumfaciens useful to Kant biologists Describ.pdf
Why is agrobacterium tumfaciens useful to Kant biologists Describ.pdfWhy is agrobacterium tumfaciens useful to Kant biologists Describ.pdf
Why is agrobacterium tumfaciens useful to Kant biologists Describ.pdf
fckindswear
ย 
Why are the payback and Accounting or Average Rate of Return sometim.pdf
Why are the payback and Accounting or Average Rate of Return sometim.pdfWhy are the payback and Accounting or Average Rate of Return sometim.pdf
Why are the payback and Accounting or Average Rate of Return sometim.pdf
fckindswear
ย 
Which of the following are potential differences between the Prokary.pdf
Which of the following are potential differences between the Prokary.pdfWhich of the following are potential differences between the Prokary.pdf
Which of the following are potential differences between the Prokary.pdf
fckindswear
ย 
When dividing, do we need to report remainder Why When dividi.pdf
When dividing, do we need to report remainder Why When dividi.pdfWhen dividing, do we need to report remainder Why When dividi.pdf
When dividing, do we need to report remainder Why When dividi.pdf
fckindswear
ย 
What are socioecology and sociobiology What can they tell us about .pdf
What are socioecology and sociobiology What can they tell us about .pdfWhat are socioecology and sociobiology What can they tell us about .pdf
What are socioecology and sociobiology What can they tell us about .pdf
fckindswear
ย 
Using the code below, answer the questionsFor the toolbar, press AL.pdf
Using the code below, answer the questionsFor the toolbar, press AL.pdfUsing the code below, answer the questionsFor the toolbar, press AL.pdf
Using the code below, answer the questionsFor the toolbar, press AL.pdf
fckindswear
ย 
true or false Strategy formulation and execution is a sequential pr.pdf
true or false Strategy formulation and execution is a sequential pr.pdftrue or false Strategy formulation and execution is a sequential pr.pdf
true or false Strategy formulation and execution is a sequential pr.pdf
fckindswear
ย 
The symptoms of depression that occur in a person diagnosed with bip.pdf
The symptoms of depression that occur in a person diagnosed with bip.pdfThe symptoms of depression that occur in a person diagnosed with bip.pdf
The symptoms of depression that occur in a person diagnosed with bip.pdf
fckindswear
ย 

More from fckindswear (20)

Explain the kinds of information that must be maintained in fixed as.pdf
Explain the kinds of information that must be maintained in fixed as.pdfExplain the kinds of information that must be maintained in fixed as.pdf
Explain the kinds of information that must be maintained in fixed as.pdf
ย 
Dr. P has a culture of stem cells and she wants them to specialize i.pdf
Dr. P has a culture of stem cells and she wants them to specialize i.pdfDr. P has a culture of stem cells and she wants them to specialize i.pdf
Dr. P has a culture of stem cells and she wants them to specialize i.pdf
ย 
Describe two ecological roles of fungi. Related concepts decomposer.pdf
Describe two ecological roles of fungi. Related concepts decomposer.pdfDescribe two ecological roles of fungi. Related concepts decomposer.pdf
Describe two ecological roles of fungi. Related concepts decomposer.pdf
ย 
Differential equations using phase plane analysis. Task 1 (Romeo .pdf
Differential equations using phase plane analysis. Task 1 (Romeo .pdfDifferential equations using phase plane analysis. Task 1 (Romeo .pdf
Differential equations using phase plane analysis. Task 1 (Romeo .pdf
ย 
Develop a stack in c with dynamic memory allocation. Use the followi.pdf
Develop a stack in c with dynamic memory allocation. Use the followi.pdfDevelop a stack in c with dynamic memory allocation. Use the followi.pdf
Develop a stack in c with dynamic memory allocation. Use the followi.pdf
ย 
Define a struct type that represents a smartphone. The struct should.pdf
Define a struct type that represents a smartphone. The struct should.pdfDefine a struct type that represents a smartphone. The struct should.pdf
Define a struct type that represents a smartphone. The struct should.pdf
ย 
Changes in the economy have determined that for the EZ shipping comp.pdf
Changes in the economy have determined that for the EZ shipping comp.pdfChanges in the economy have determined that for the EZ shipping comp.pdf
Changes in the economy have determined that for the EZ shipping comp.pdf
ย 
Broadly speaking, the economy consists of households, firms, governm.pdf
Broadly speaking, the economy consists of households, firms, governm.pdfBroadly speaking, the economy consists of households, firms, governm.pdf
Broadly speaking, the economy consists of households, firms, governm.pdf
ย 
A committee consists of 13 Republicans and 16 Democrats. How many dif.pdf
A committee consists of 13 Republicans and 16 Democrats. How many dif.pdfA committee consists of 13 Republicans and 16 Democrats. How many dif.pdf
A committee consists of 13 Republicans and 16 Democrats. How many dif.pdf
ย 
2. July 01 Record the dividend received from the foreign subsidiary..pdf
2. July 01 Record the dividend received from the foreign subsidiary..pdf2. July 01 Record the dividend received from the foreign subsidiary..pdf
2. July 01 Record the dividend received from the foreign subsidiary..pdf
ย 
You have isolated a new virus, determined it has a lipid envelope,.pdf
You have isolated a new virus, determined it has a lipid envelope,.pdfYou have isolated a new virus, determined it has a lipid envelope,.pdf
You have isolated a new virus, determined it has a lipid envelope,.pdf
ย 
Write the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdfWrite the Java source code necessary to build a solution for the pro.pdf
Write the Java source code necessary to build a solution for the pro.pdf
ย 
Why is agrobacterium tumfaciens useful to Kant biologists Describ.pdf
Why is agrobacterium tumfaciens useful to Kant biologists Describ.pdfWhy is agrobacterium tumfaciens useful to Kant biologists Describ.pdf
Why is agrobacterium tumfaciens useful to Kant biologists Describ.pdf
ย 
Why are the payback and Accounting or Average Rate of Return sometim.pdf
Why are the payback and Accounting or Average Rate of Return sometim.pdfWhy are the payback and Accounting or Average Rate of Return sometim.pdf
Why are the payback and Accounting or Average Rate of Return sometim.pdf
ย 
Which of the following are potential differences between the Prokary.pdf
Which of the following are potential differences between the Prokary.pdfWhich of the following are potential differences between the Prokary.pdf
Which of the following are potential differences between the Prokary.pdf
ย 
When dividing, do we need to report remainder Why When dividi.pdf
When dividing, do we need to report remainder Why When dividi.pdfWhen dividing, do we need to report remainder Why When dividi.pdf
When dividing, do we need to report remainder Why When dividi.pdf
ย 
What are socioecology and sociobiology What can they tell us about .pdf
What are socioecology and sociobiology What can they tell us about .pdfWhat are socioecology and sociobiology What can they tell us about .pdf
What are socioecology and sociobiology What can they tell us about .pdf
ย 
Using the code below, answer the questionsFor the toolbar, press AL.pdf
Using the code below, answer the questionsFor the toolbar, press AL.pdfUsing the code below, answer the questionsFor the toolbar, press AL.pdf
Using the code below, answer the questionsFor the toolbar, press AL.pdf
ย 
true or false Strategy formulation and execution is a sequential pr.pdf
true or false Strategy formulation and execution is a sequential pr.pdftrue or false Strategy formulation and execution is a sequential pr.pdf
true or false Strategy formulation and execution is a sequential pr.pdf
ย 
The symptoms of depression that occur in a person diagnosed with bip.pdf
The symptoms of depression that occur in a person diagnosed with bip.pdfThe symptoms of depression that occur in a person diagnosed with bip.pdf
The symptoms of depression that occur in a person diagnosed with bip.pdf
ย 

Recently uploaded

Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
David Douglas School District
ย 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
Mohammad Al-Dhahabi
ย 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
ย 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
Payaamvohra1
ย 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
National Information Standards Organization (NISO)
ย 
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...
Nguyen Thanh Tu Collection
ย 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
ย 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
ย 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
MJDuyan
ย 
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...
Nguyen Thanh Tu Collection
ย 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
ย 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
ย 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
ย 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
Himanshu Rai
ย 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
TechSoup
ย 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
TechSoup
ย 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
ย 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
ย 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
Krassimira Luka
ย 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
OH TEIK BIN
ย 

Recently uploaded (20)

Juneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School DistrictJuneteenth Freedom Day 2024 David Douglas School District
Juneteenth Freedom Day 2024 David Douglas School District
ย 
skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)skeleton System.pdf (skeleton system wow)
skeleton System.pdf (skeleton system wow)
ย 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
ย 
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
NIPER 2024 MEMORY BASED QUESTIONS.ANSWERS TO NIPER 2024 QUESTIONS.NIPER JEE 2...
ย 
Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"Benner "Expanding Pathways to Publishing Careers"
Benner "Expanding Pathways to Publishing Careers"
ย 
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 8 - Cแบข Nฤ‚M - FRIENDS PLUS - Nฤ‚M HแปŒC 2023-2024 (B...
ย 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
ย 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
ย 
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) CurriculumPhilippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
Philippine Edukasyong Pantahanan at Pangkabuhayan (EPP) Curriculum
ย 
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...
Bร€I TแบฌP Bแป” TRแปข TIแบพNG ANH LแปšP 9 Cแบข Nฤ‚M - GLOBAL SUCCESS - Nฤ‚M HแปŒC 2024-2025 - ...
ย 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
ย 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
ย 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
ย 
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem studentsRHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
RHEOLOGY Physical pharmaceutics-II notes for B.pharm 4th sem students
ย 
Accounting for Restricted Grants When and How To Record Properly
Accounting for Restricted Grants  When and How To Record ProperlyAccounting for Restricted Grants  When and How To Record Properly
Accounting for Restricted Grants When and How To Record Properly
ย 
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
Elevate Your Nonprofit's Online Presence_ A Guide to Effective SEO Strategies...
ย 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
ย 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
ย 
Temple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation resultsTemple of Asclepius in Thrace. Excavation results
Temple of Asclepius in Thrace. Excavation results
ย 
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptxA Free 200-Page eBook ~ Brain and Mind Exercise.pptx
A Free 200-Page eBook ~ Brain and Mind Exercise.pptx
ย 

Please write a function in C++ that reads from a txt file containing.pdf

  • 1. Please write a function in C++ that reads from a txt file containing two columns of integers. The function must find the union and intersection of the two columns. Thank you in advance for your help. Please write in basic beginner C++ code and include detailed comments so that I can understand the processes. Solution #include #include #include using namespace std; int main() { string name; cin>>name; ifstream ins; ins.open(name); int a,b; vector first,second; while(ins>>a) { ins>>b; first.push_back(a); second.push_back(b); } vector andd,orr; for(int i=0;i