formatting source-code for d7af6fdc8c

This commit is contained in:
github-actions
2020-05-29 23:26:30 +00:00
parent edb3d51ec2
commit 7ad1f171c1
176 changed files with 5342 additions and 4288 deletions

View File

@@ -2,7 +2,8 @@
#include <iostream>
int main() {
int main()
{
int n;
std::cout << "\nEnter the length of your array : ";
std::cin >> n;
@@ -10,15 +11,18 @@ int main() {
std::cout << "\nEnter any " << n << " Numbers for Unsorted Array : ";
// Input
for (int i = 0; i < n; i++) {
for (int i = 0; i < n; i++)
{
std::cin >> Array[i];
}
// Sorting
for (int i = 1; i < n; i++) {
for (int i = 1; i < n; i++)
{
int temp = Array[i];
int j = i - 1;
while (j >= 0 && temp < Array[j]) {
while (j >= 0 && temp < Array[j])
{
Array[j + 1] = Array[j];
j--;
}
@@ -27,7 +31,8 @@ int main() {
// Output
std::cout << "\nSorted Array : ";
for (int i = 0; i < n; i++) {
for (int i = 0; i < n; i++)
{
std::cout << Array[i] << "\t";
}