I have to write a program that reads in 15 prices and stores them in a sequential container and then sorts them into increasing order. The program then should find and display: The trading range(the lowest and highest prices) .. and A sequence that shows how much the price rose and fell each day.
I am having problems with creating the sequence to show how much the price rose and fell. I'm trying to use `adjacent_difference` but I receive "Segmentation fault" errors when I run it. Any help would be greatly appreciated

```
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main(void)
{
 int i;
 int s=15;
 int p;
 vector <int> prices;
 vector <int> dif;

  cout<<"Please enter the trading price: ";
  while(prices.size()<s && cin>>p)
    prices.push_back(p);
  cout<<"The differences in price: "<<adjacent_difference(prices.begin(),prices.end(),dif.begin())<<endl;
  sort(prices.begin(),prices.end());
  cout<<"The smallest number is "<<*min_element(prices.begin(),prices.end())<<endl;
  cout<<"The latgest number is "<<*max_element(prices.begin(),prices.end())<<endl;

return 0;
}

```