2
I. Write program 1. Declare an double array with max 100 elements 2. Input an positive integer n that indicated the number of element of array 3. Input n elements of array 4. Display array has just been inputted 5. Calculate sum of all elements, sum of elements that has odd index, average elements at index is a prime, average of element at odd index II. Viết các hàm thực hiện các yêu cầu sau 1. Nhập vào kích thước và các phần tử của một mảng một chiều void nhap(int *n, int mang[]) 2. Copy một mảng sang một mảng khác void copy(int nguon[], int dich[], int n) 3. tìm kiếm k trong mảng, không có trả về -1, có trả về chi so đầu tiên int tim(int mang[], int n, int k) 4. In danh sách vị trí của các phần tử có giá trị bằng phần tử nhỏ nhất void nhonhat(int mang[], int n) 5. Nhân đôi giá trị của các phần tử ở vị trí lẻ void nhandoi(int mang[], int n) 6. Nhân đôi giá trị của các phần tử lẻ void nhandoi1(int mang[], int n) 7. Tạo ra mảng khác có các phần tử theo thứ tự ngược lại void mangnguoc(int nguon[], int dich[], int n) 8. Tạo ra mảng khác có các phần tử đã sx theo thứ tự tăng dần void sxep(int nguon[], int dich[], int n)

Array Reflection 1

  • Upload
    minhhd

  • View
    212

  • Download
    0

Embed Size (px)

DESCRIPTION

bài tập C

Citation preview

ArrayReflection1.docx

I. Write program1. Declare an double array with max 100 elements2. Input an positive integer n that indicated the number of element of array3. Input n elements of array4. Display array has just been inputted5. Calculate sum of all elements, sum of elements that has odd index, average elements at index is a prime, average of element at odd indexII. Vit cc hm thc hin cc yu cu sau1. Nhp vo kch thc v cc phn t ca mt mng mt chiuvoid nhap(int *n, int mang[])2. Copy mt mng sang mt mng khcvoid copy(int nguon[], int dich[], int n)3. tm kim k trong mng, khng c tr v -1, c tr v chi so u tinint tim(int mang[], int n, int k)4. In danh sch v tr ca cc phn t c gi tr bng phn t nh nhtvoid nhonhat(int mang[], int n)5. Nhn i gi tr ca cc phn t v tr lvoid nhandoi(int mang[], int n)6. Nhn i gi tr ca cc phn t lvoid nhandoi1(int mang[], int n)7. To ra mng khc c cc phn t theo th t ngc livoid mangnguoc(int nguon[], int dich[], int n)8. To ra mng khc c cc phn t sx theo th t tng dnvoid sxep(int nguon[], int dich[], int n)9. chn k vo sau phn t th 3, nu s ft