Code:
#include "stdafx.h"
#include <cstdlib>
#include <iostream>
#include <ctime>
using namespace std;
int main()
{
const char* article[5]={"the", "a", "one", "some", "any"};
const char* noun[5]={"boy", "girl", "dog", "town", "car"};
const char* verb[5]={"drove", "jumped", "ran", "walked", "skipped"};
const char* preposition[5]={"to", "from", "over", "under", "on"};
srand((unsigned)time(NULL));
cout<<*(article+(rand()%5));
cout<<" ";
cout<<*(noun+(rand()%5));
cout<<" ";
cout<<*(verb+(rand()%5));
cout<<" ";
cout<<*(preposition+(rand()%5));
cout<<" ";
cout<<*(article+(rand()%5));
cout<<" ";
cout<<*(noun+(rand()%5));
cout<<"."<<endl;
return 0;
}