代写 C Files to submit: combs.s

Files to submit: combs.s
Time it took Matthew to complete: 1.5 hours (Start early. This is a time consuming problem.)
• All programs must compile without warnings when using the -Wall and -Werror options
• Submit only the files requested
◦ Do NOT submit folders or compressed files such as .zip, .rar, .tar, .targz, etc • If submitting in a group on Grade Scope please make sure to mark your partner.
◦ Only one of you has to submit there
• Your program must match the output exactly to receive credit.
◦ Make sure that all prompts and output match mine exactly.
◦ Easiest way to do this is to copy and paste them
• All input will be valid unless stated otherwise
• Print all real numbers to two decimal places unless otherwise stated
• The examples provided in the prompts do not represent all possible input you can receive.
• All inputs in the examples in the prompt are underlined
◦ You don’t have to make anything underlined it is just there to help you differentiate between what you are supposed to print and what is being given to your program
• If you have questions please post them on Piazza

Write a program called combs.s that generates all the possible combinations of a set of items of a given size.
1. Your program should be callable from C and have the following signature
1. int** get_combs(int* items, int k, int len)
2. This function should generate all possible combinations of items taken k at a time and return a 2-D array where each row contains one combination
1. The combinations should be added to the 2-D array in their natural order
2. This 2-D array should be dynamically allocated
3. As a hint you will probably need to develop a helper function that actually computes the combinations
3. You have been given a file called main.c that will get the inputs and call your function
1. Your function must be callable from this file
2. You will also find some helpful functions in main.c that you can call from your program
4. You have also been given a makefile that should compile your program. Your program MUST be able to be compiled by this makefile.
1. For those of you running 64 bit versions of Linux you may need to install the 32 bit
binaries.
2. The command to install on Ubuntu is: apt-get -y install gcc-multilib
4. Examples
1. How many items do you have: 5 Enter your items: 1 2 3 4 5 Enter k: 3
1 23
1 24 1 25 1 34 1 35 1 45 2 34 2 35 2 45 3 45
2. How many items do you have: 5 Enter your items: 1 2 3 4 5 Enter k: 4
1 234
1 235 1 245 1 345 2 345