Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - C language: enter n integers in the array u, and enter a positive integer k (0

# Contains? " stdio.h "

# Contains? " string.h "

int? Major (Invalid) {

int? n,u[40],I,k;

w

C language: enter n integers in the array u, and enter a positive integer k (0

# Contains? " stdio.h "

# Contains? " string.h "

int? Major (Invalid) {

int? n,u[40],I,k;

w

C language: enter n integers in the array u, and enter a positive integer k (0

# Contains? " stdio.h "

# Contains? " string.h "

int? Major (Invalid) {

int? n,u[40],I,k;

while( 1){

if(scanf("%d ",& ampn),n==0)

Break;

scanf("%d ",& ampk);

for(I = 0; I & ltn;; scanf("%d ",u+i++));

memcpy(u+n,u,sizeof(int)*(k));

memcpy(u,u+k,sizeof(int)*(n-k));

memcpy(u+n-k,u+n,sizeof(int)*(k));

for(n -,I = 0; I & ltn;; printf("%d?" ,u[i++]));

printf("%d\n ",u[n]);

}

Return? 0;

} or

//# contains? "stdafx.h"//vc++6.0 add this line.

# Contains? " stdio.h "

int? Major (Invalid) {

int? n,u[40],I,k;

while( 1){

if(scanf("%d ",& ampn),n==0)

Break;

scanf("%d ",& ampk);

for(I = 0; I & ltn;; scanf("%d ",u+i++));

for(I = 0; I & ltk;; u[n+I]= u[i++]);

for(I = 0; I<n-k; u[I]= u[k+i++]);

for(I = 0; I & ltk;; u[n-k+I]= u[n+i++]);

for(n -,I = 0; I & ltn;; printf("%d?" ,u[i++]));

printf("%d\n ",u[n]);

}

Return? 0;

} You choose one. ...