style: format code

This commit is contained in:
yanglbme
2019-08-21 10:10:08 +08:00
parent abc0d365de
commit 69ddc9fc52
101 changed files with 3154 additions and 2984 deletions

View File

@@ -1,5 +1,5 @@
#include <iostream>
#include<climits>
#include <climits>
using namespace std;
// Function to find the Minimum number of coins required to get Sum S
@@ -7,11 +7,10 @@ int findMinCoins(int arr[], int n, int N)
{
// dp[i] = no of coins required to get a total of i
int dp[N + 1];
// 0 coins are needed for 0 sum
dp[0] = 0;
// 0 coins are needed for 0 sum
dp[0] = 0;
for (int i = 1; i <= N; i++)
{
@@ -39,13 +38,13 @@ int findMinCoins(int arr[], int n, int N)
int main()
{
// No of Coins We Have
int arr[] = { 1, 2, 3, 4 };
int arr[] = {1, 2, 3, 4};
int n = sizeof(arr) / sizeof(arr[0]);
// Total Change Required
int N = 15;
cout << "Minimum Number of Coins Required "<< findMinCoins(arr, n, N) << "\n";
cout << "Minimum Number of Coins Required " << findMinCoins(arr, n, N) << "\n";
return 0;
}