Skip to content

Commit

Permalink
Update Factional_Knapsack.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
WaderManasi authored Sep 22, 2020
1 parent c8749e6 commit cd07cd1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Greedy Algorithms/Factional_Knapsack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,12 @@ int main()
cout<<setprecision(2)<<fixed;
cin>>n>>capacity;
//array of structures

Item arr[n];
for(int i=0;i<n;i++)
{
cin>>arr[i].value>>arr[i].weight;
}
cout<<fractionalKnapsack(capacity,arr,n);
return 0;
}
}

0 comments on commit cd07cd1

Please sign in to comment.