Break the number into three parts | C ++ program to count number of ways to break a number in three parts . ; Function to count number of ways to make the given number n ; Driver Function
#include <bits/stdc++.h> NEW_LINE #define ll  long long int NEW_LINE using namespace std ; ll count_of_ways ( ll n ) { ll count ; count = ( n + 1 ) * ( n + 2 ) / 2 ; return count ; } int main ( ) { ll n = 3 ; cout << count_of_ways ( n ) << endl ; return 0 ; }