Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions day20/C++/PartitionDay20.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @author divyakhetan
/*
* @author divyakhetan
* @date 16/1/2019
*/

Expand All @@ -11,6 +11,7 @@ using namespace std;

int main(){
int n;
cout << "Enter the number of values you want to have."<<endl;
cin >> n;
int a[n];
for(int i = 0; i < n; i++){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also add a print statement to inform user that he needs to enter a value (integer) each time.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey aadikamat,
Thanks for the suggestion. I have done the suggested changes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a print statement before line 18 though.

Expand Down Expand Up @@ -42,9 +43,11 @@ int main(){

ans.push_back(part); //for the remaining array
//cout << ans.size();
cout<<"Your answer is :- ";
for(int i = 0; i < ans.size(); i++){
for(int j = 0; j < ans[i].size(); j++){
cout << ans[i][j] << " ";
cout<< ans[i][j] << " ";

}
cout << endl;
}
Expand Down