Похоже, вы пытаетесь динамически выделить массив pair<int,int>
s '. Предпочитайте std :: vector для такой задачи:
#include<vector>
int n;
cin>>n;
std::vector<pair<int,int>> v(n);
Что касается исходного вопроса, вы можете создать массивы pair<int,int>
s ', либо массивы C в стиле, либо std :: arrays. , вам нужно знать размер во время компиляции:
int n;
cin >> n;
//C-style arrays
pair<int,int> a[n]; //this may work on some compilers, but is non-standard behaviour
//std::arrays
#include<array>
std::array<pair<int,int>,n> a; //this will not compile at all, "n" must be known at compile-time