Vector push_back() into multiple vectors

Here's my code when the user inputs a day of the week followed by int, it gets pushed back into that respected vector, but in my case it pushes back only to the vector mon and if i change the else-if statements to if-statements it pushes back to all vectors, how do i get it to push_back(day); to the respected day of week vector. Also when i terminate with "||" it only exists the while loop how do i get it to terminate the whole program.






#include<iostream>
#include<vector>
using namespace std;

int main()
{
vector<int>tues;
vector<int>mon;
vector<int>wed;
vector<int>thur;
vector<int>fri;
vector<int>sat;
vector<int>sun;
string week_day;
int day=0;


cout<<"Please enter a day of the week followed by a number\n";


while(cin>>week_day&&cin>>day&&week_day!="||")

{

if(week_day=="mon"||"monday"||"Monday")
{
mon.push_back(day);


}
else if(week_day=="tues"||"tuesday"||"Tuesday")
{

tues.push_back(day);

}

else if(week_day=="wed"||"wednesday"||"Wednesday"){

wed.push_back(day);
}

else if(week_day=="thur"||"thursday"||"Thurday"){


thur.push_back(day);}

else if(week_day=="fri"||"friday"||"Friday")
{

fri.push_back(day);
}
else if(week_day=="sat"||"Saturday"||"saturday"){

sat.push_back(day);

}

else if(week_day=="sun"||"Sunday"||"sunday")
{
sun.push_back(day);
}

cout<<"please enter a day of week and a number(enter || to terminate)\n";


}

for(int i=0; i<mon.size();++i){
cout<<"Your monday values: "<<mon[i]<<'\n';}




for(int a=0; a<tues.size();++a){
cout<<"Your tuesday values: "<<tues[a]<<'\n';}



for(int b=0; b<wed.size();++b){
cout<<"Your wednesday values: "<<wed[b]<<'\n';}



for(int c=0; c<thur.size();++c){
cout<<"Your thursday values: "<<thur[c]<<'\n';}



for(int d=0; d<fri.size();++d){
cout<<"Your friday values: "<<fri[d]<<'\n';}



for(int e=0; e<sat.size();++e){
cout<<"Your wednesday values: "<<sat[e]<<'\n';}

for(int f=0; f<sun.size();++f){
cout<<"Your sunday values: "<<sun[f]<<'\n';}







}
if(week_day=="mon"||week_day=="monday"||week_day=="Monday")
Do the same with the other if statements.
Topic archived. No new replies allowed.