Construct an Array of size N whose sum of cube of all elements is a perfect square | C ++ implementation of the above approach ; Function to construct an array of size N ; Prints the first N natural numbers ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; void constructArray ( int N ) { for ( int i = 1 ; i <= N ; i ++ ) { cout << i << " ▁ " ; } } int main ( ) { int N = 5 ; constructArray ( N ) ; return 0 ; }