#include <algorithm>
#include <iostream>
using namespace std;

int main() {
    int arr[9];
    for (int i = 0;i < 9;i++) {
        cin >> arr[i];
    }
    int s[7];
    do{
        if (arr[0]+arr[1]+arr[2]+arr[3]+arr[4]+arr[5]+arr[6] == 100) {
            s[0] = arr[0];
            s[1]=arr[1];
            s[2]=arr[2];
            s[3]=arr[3];
            s[4]=arr[4];
            s[5]=arr[5];
            s[6]=arr[6];
            break;
        }
    }while(next_permutation(arr,arr+9));
    sort(s,s+7);
    for (int i = 0;i < 7;i++) {
        cout << s[i] << "\n";
    }
    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: