mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-25 06:49:36 +03:00
use stdbool.h instead of manually defined macros
This commit is contained in:
parent
e2add348d9
commit
6b0f57d372
@ -1,12 +1,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#define MAX 20
|
#define MAX 20
|
||||||
#define TRUE 1
|
|
||||||
#define FALSE 0
|
#include <stdbool.h>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int i, array_sort[MAX] = {0}, is_sorted = FALSE, change_place;
|
int i, array_sort[MAX] = {0}, is_sorted = false, change_place;
|
||||||
|
|
||||||
/* For example
|
/* For example
|
||||||
Insertion random values in array to test
|
Insertion random values in array to test
|
||||||
@ -21,7 +21,7 @@ int main()
|
|||||||
|
|
||||||
while (is_sorted)
|
while (is_sorted)
|
||||||
{
|
{
|
||||||
is_sorted = FALSE;
|
is_sorted = false;
|
||||||
|
|
||||||
for (i = 0; i < MAX - 1; i++)
|
for (i = 0; i < MAX - 1; i++)
|
||||||
{
|
{
|
||||||
@ -30,7 +30,7 @@ int main()
|
|||||||
change_place = array_sort[i];
|
change_place = array_sort[i];
|
||||||
array_sort[i] = array_sort[i + 1];
|
array_sort[i] = array_sort[i + 1];
|
||||||
array_sort[i + 1] = change_place;
|
array_sort[i + 1] = change_place;
|
||||||
is_sorted = TRUE;
|
is_sorted = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user