formatting source-code for 153fb7b8a5

This commit is contained in:
github-actions
2020-05-30 04:02:09 +00:00
parent 92fe9495ec
commit 8a2de9842b
175 changed files with 1671 additions and 3460 deletions

View File

@@ -2,8 +2,7 @@
#include <iostream>
int main()
{
int main() {
int n;
std::cout << "\nEnter the length of your array : ";
std::cin >> n;
@@ -11,18 +10,15 @@ 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--;
}
@@ -31,8 +27,7 @@ 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";
}