current position:Home>C language parameter array deletion sorting

C language parameter array deletion sorting

2022-01-26 22:54:08 CSDN Q & A

Defined function int fun(int a[],int n), Parameter array a The array element values in have been sorted from small to large ,fun The function deletes all the same numbers in the one-dimensional array of formal parameters , Leaving only one , Function returns delete The number of data in the back array .main Function fun Function test .
n It's an integer , Move the numbers back in order m A place , Last m The number becomes the first m Number




Refer to the answer 1:

Double loop traversal searches for each integer , If it is the same, delete the last




Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201262254058997.html

Random recommended