at lines 25-27 how can i check for all the "psomi" if there is a smaller "basi " and after cout the number of the "psomi " that there is a smaller " basi "
#include<iostream>
#include<vector>
usingnamespace std;
int main(){
int a, z;
vector<int> psomi;
vector<int> basi;
int num = 0;
int t = 0;
cin >> a;
for (int i = 0; i < a; i++) {
cin>>a;
psomi.push_back(i);
}
for (int i = 0; i < a; i++) {
cin>>a;
basi.push_back(i);
}
if (psomi <= basi){
t++;
}
cout << t << endl;
return 0;
}
To start off, why do you have duplicate cin >> a statements in your for loops? I guarantee something will mess up with your output if you do that.
Also, a vector is a container, and as with all containers, you can't just call if( psomi <= basi); the compiler won't know what you're referring to. Are you talking about how big the vector is (size), or are you talking about a specific thing inside both of them (Vector[index])?
I would suggest starting here, and slowly working that into your code.