题目内容
运行以下程序,输入1 2 3 4 5,写出程序运行结果。#include void mov(int *x, int n, int m);int main(void){int a[5], i, *p;for(p = a, i = 0; i < 5; i++)scanf("%d", p++);mov(a,5,3);printf("After moved: ");for(i = 0; i < 4; i++)printf("%d#",a[i]);printf("%d",a[4]);return 0;}void mov(int *x, int n, int m){int i,j,k;for(i = 0; i < m; i++){k=x[n-1] ;for(j = n-1; j > 0; j--)x[j] = x[j - 1];x[0] = k;}}
查看答案
搜索结果不匹配?点我反馈