How would I change the following code to have the for-statements based on user input? Note: The user can input any amount of positive integers (assume each input is an odd number of positive integers)...


How would I change the following code to have the for-statements based on user input? Note: The user can input any amount of positive integers (assume each input is an odd number of positive integers)


#include

using namespace std;

int main(){

    vector a;

    cout<>

    for(int i=0;
i <>; i++){

        int t;

        cin>>t;

        a.push_back(t);

    }

    for(int i=0;
i <>; i++){

        int t = count(a.begin(), a.end(), a[i]);

        if(t==1){

            cout<>
            break;

        }

    }

    return 0;

}



Example Output #1:


Enter integers: 2 1 55 3 2 1 4 4 2 2 55


Exclusive: 3




Example Output #2:


Enter integers: 12 4 7 4 12


Exclusive: 7





Jun 07, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here