I'm trying to write a code that will provide all possible combination of the number 13, using three digits. (at this stage everything works fine) .
But now i would like to remove repetitions, ex. 10+2+1 = 13 and 1+2+10= 13 i wud like to remove this kind of repetition , but i'm not sure how?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// sort algorithm example
#include <iostream>
#include <cmath>
usingnamespace std;
void main(void) {
for (int i = 0; i<=13 ; i++){
for(int b = 0; b <= 13; b++){
for (int c=0; c<=13;c++){
if ((i + b + c) == 13){
cout << i << " " << b << " " << c << endl;}
}}}
system("pause");
}