#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int k = 0;
int n;
int y[0];
ifstream infile;
infile.open("xxx.in.txt");
infile.seekg(1); //stores line 1 in n
infile >> n;
infile.seekg(2); //stores line 2 in array
infile >> y[0];
infile.close();
for( int x = 0; x < n; x++ )
for( int j = 1; j < n; j++ )
if ( y[x] > y[j] )
{
k = k++; //should probably use a flag
}
ofstream outfile;
outfile.open("xxx.out.txt");
outfile << k;
outfile.close();
return 0;
}
When i run the programme,it should run automatically because it doesnt need user input.But instead,when i run it,it doesnt do any of that,its just a blank command prompt