Your logic here 
min = N;
max = N;
initializing them with N, is wrong. When you have the minimum number for example 0 in your user input, and your N is greater than that 0, you never find your minimum. The same will happen for the maximum. 
Initialize min with largest possible value of int and max with  least possible value, like the following:
int min = std::numeric_limits<int>::max();
int max = std::numeric_limits<int>::min();
Suggestion - 1
As it looks like you do not want to save the user input to find mim and max you can use std::min and std::max functions as follows:
#include <iostream>
#include <limits>    //  std::numeric_limits<>
#include <algorithm> //  std::min, std::max
int main()
{
    // initialize like this
    int min = std::numeric_limits<int>::max();
    int max = std::numeric_limits<int>::min();
    int N;
    std::cin >> N;
    while (N--)
    {
        int x; std::cin >> x;
        min = std::min(x, min);  // use std::min
        max = std::max(x, max);  // use std::max
    }
    std::cout << min << " " << max;
    return 0;
}
Suggestion - 2
If you want to find the min-max of an already existing array, you might wanna consider use std::minmax_element instead.
#include <algorithm>   //  std::minmax_element
#include <iostream>
#include <vector>
int main()
{
    int N; std::cin >> N;
    std::vector<int> v(N);
    for(auto& element: v) std::cin >> element;
    // do something.....
    // to find min-max of the array
    auto result = std::minmax_element(v.begin(), v.end());
    std::cout << "min element is: " << *result.first << '\n';
    std::cout << "max element is: " << *result.second << '\n';
}
Side Note: Do not practice with std namespüace std;, why? see this post: Why is “using namespace std” considered bad practice?