Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- void dap(int* result)
- {
- for(int i=0; i<7; i++)
- cout<<result[i]<<endl;
- }
- int main() {
- int arr[9];
- for(int i=0; i<9; i++)
- {
- cin>>arr[i];
- }
- sort(arr,arr+9);
- int height=0;
- int result[7];
- while(1)
- {
- int temp1=0;
- int temp2=0;
- for(int i=0; i<9; i++)
- {
- temp1=arr[i];
- for(int k=i+1; k<9; k++)
- {
- temp2=arr[k];
- int a=0;
- for(int s=0; s<9; s++)
- {
- if(arr[s]!=temp1 && arr[s]!=temp2)
- {
- result[a]=arr[s];
- a++;
- height+=arr[s];
- }
- }
- if(height==100)
- {
- dap(result);
- return 0;
- }
- height=0;
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment