It's no clearer what you're trying to do now than it was 5 months ago.
How To Add A If Statment To This Code - C And C++ | Dream.In.Code

Before you copy/paste yourself into a 10-level deep monstrosity, make a simplified version which is a lot easier on the eye, and might help us figure out what it is you actually want (see also The XY Problem ).
Code:
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
   const int NMAX = 5; // was 15;
   
   int s = 0;

   ostream & out = cout;                // for screen

   for ( int a = 1; a <= NMAX - 2; a++ )
   {
      for ( int b = a + 1; b <= NMAX - 1; b++ )
      {
         for ( int c = b + 1; c <= NMAX; c++ )
         {
            // now what?
         }
      }
   }
}
Make a small program which demonstrates the problem and actually compiles.
Dumping a 100+ line mess with no description as to what (or why) isn't going to work out for you.

Such questions come to mind as
- Why only the first two loops have NMAX-2 and NMAX-1 ?
- What is the relationship between NMAX and how many nested loops you have?