genern1.cpp

We use cookies. Read the Privacy and Cookie Policy

genern1.cpp

#include ‹stl.h›

#include ‹iostream.h›

#include ‹stdlib.h›

int main() {

 vector‹int› v1(10);

 generate_n(v1.begin(), v1.size(), rand);

 for (int i = 0; i ‹ 10; i++) cout ‹‹ v1[i] ‹‹ ;

 cout ‹‹ endl;

 return 0;

}