Number of non | A naive C ++ solution to count solutions of a + b + c = n ; Returns count of solutions of a + b + c = n ; Driver code
#include <bits/stdc++.h> NEW_LINE using namespace std ; int countIntegralSolutions ( int n ) { return ( ( n + 1 ) * ( n + 2 ) ) / 2 ; } int main ( ) { int n = 3 ; cout << countIntegralSolutions ( n ) ; return 0 ; }