diff --git a/Lsn10AlS.c b/Lsn10AlS.c new file mode 100644 index 0000000..a7aafa0 --- /dev/null +++ b/Lsn10AlS.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include + +#define T char +#define true 1 == 1 +#define false 1 != 1 +typedef int boolean; + + +int hash(char *S) +{ + int i,r=0; + while(*S) + { + r+=(int)(*S); + S++; + } + return r; +} + +int profitCaculation(int* coin, const int n, const int maxN) { + int arr[n]; + + clearIntArr(arr, n); + + int sum = 0; + int o = 0; + for (int i = 0; i < maxN; i++) { + if ((coin[i]*2) < 98) { + sum += coin[i]; + o++; + } + if (sum < 98) break; + } + return o; +} + +void task2() { + const int Cmax = 5; + const int maxN = 98; + int coin[] = { 50, 10, 5, 2, 1 }; + + printf("%d", profitCaculation(coin, Cmax, maxN)); +} +int main() +{ + + + + return 0; + +} \ No newline at end of file