Здравей. След малко ще ти кача програмата. Дано се сетиш пак да провериш тук понеже си се регистрирал/а само и само за да попиташ за задачата. Е аз се регистрирах само и само да ти отговоря.
EDIT:
/*
This program is writen by Kostadin Anev.
*/
#include <stdio.h>//for scanf, printf.. e.c.t.
#include <algorithm>//for sort function
#include <vector>//for vectors
struct myclass {
bool operator() (int i,int j) { return (i<j);}
} myObject;
int main()
{
unsigned int howMuchNums = 4;
unsigned int myNums[howMuchNums];
unsigned int checkNum;
printf("Type %d numbers that you want to compare:\n", howMuchNums);
for(unsigned int cnt=0; cnt<howMuchNums; cnt++)
{
scanf("%d", &myNums[cnt]);
}
std::vector<int> myVector(myNums, myNums + howMuchNums);
std::vector<int>::iterator it;
sort(myVector.begin(), myVector.end(), myObject);
// print out content:
printf("Numbers sorted looks like this:");
for(it=myVector.begin(); it!=myVector.end(); ++it) printf(" %d ", *it);
}
Проверката която ще проверява вектора дали съдържа по-малки числа от 7 ще си я направиш сам/а, аз само ще ти подскажа, че може да ползваш:
myVector.erase(int starPos, int endPost)