C语言 定义一个长度为10的整型数组 用for语法?答:int arr[10]= {21,45,38,66,73,14,55,99,85,10};printArr(arr,10);sort(arr,10);printArr(arr,10);return 0;}
建立一个整型数组(长度为10),元素可以自己任意设定; 将数组中的元素按...答:define N 10 int a[N]={1,7,5,6,3,4,9,8,2,10},i,j,k;for ( i=0;i<N-1;i++ )for ( j=i+1;j<N;j++ )if ( a[i]>a[j] ) { k=a[i];a[i]=a[j];a[j]=k; } for ( i=0;i<N;i++ ) printf("%d ",a[i]); printf("\n");
一个长度为10的整型数组a[10]={3,4,6,7,8,4,2,1,9,10},答:include <stdio.h> int main (){ int a[10],d,f,t=0,temp;for(d=0;d<=9;d++){scanf("%d\n",&a[d]);} for(f=9;f>9/2;f--){temp=a[t];a[t]=a[f];a[f]=temp;t=t+1;} for(t=0;t<=9;t++){printf("%d ",a[t]);} printf("\n");} ...
定义一个长度为10的整型数组,其值为{21,45,38,66,73,14,55,99,85,10...答:import java.util.Scanner;public class Test { public static void main(String[] args) { int[] array = new int[1000];for (int i = 0; i < 1000; i++) { array[i] = i;} boolean loopFlag = true;while(loopFlag) { System.out.println("请输入字符:");Scanner sc = new ...