Ejemplo n.º 1
0
Archivo: P281E8.c Proyecto: ssfdust/C
int main (void){
		double origin[3][5] = {
				{1,2,3,4,5},
				{6,7,8,9,10},
				{11,12,13,14,15}
		};
		double target[ROWS][COLS];

		copy_arr ( origin, target, COLS); 
		show_arr ( origin, COLS);
		show_arr ( target, COLS);
}
Ejemplo n.º 2
0
int main(void)
{
  int arr[SIZE1][SIZE2] = {{1,1,1,1,1},
                           {2,2,2,2,2},
			   {3,3,3,3,3}};
  
  show_arr(arr,SIZE1);
  double_value(arr,SIZE1);
  show_arr(arr,SIZE1);

  return 0;
}
Ejemplo n.º 3
0
int main(void)
{
  int arr1[SIZE] = {1,2,3,4};
  int arr2[SIZE] = {5,6,7,8};
  int arr3[SIZE];

  add_arr(arr1,arr2,arr3,SIZE);
  show_arr(arr1,SIZE);
  show_arr(arr2,SIZE);
  show_arr(arr3,SIZE);

  return 0;
}
Ejemplo n.º 4
0
Archivo: 80_2.c Proyecto: shixv/test
int main(void)
{
    double source[5] = {1.1,2.2,3.3,4.4,5.5};
    double target1[5];
    double target2[5];

    copy_arr(source,target1,5);
    copy_ptr(source,target2,5);

    show_arr(target1,5);
    show_arr(target2,5);

    return 0;
}
Ejemplo n.º 5
0
Archivo: main.c Proyecto: Lu511/-
int main(void)
{
    struct Arr arr;
    //int val;
    int length;
    printf("输入所需个数:");
    scanf("%d",&length);
    init_arr(&arr,length);
    append_arr(&arr, 1);
    append_arr(&arr, 7);
    append_arr(&arr, 6);
    append_arr(&arr, 4);
    append_arr(&arr, 2);
    sort_arr(&arr);

//    if (delete_arr(&arr, 1, &val)) {
//        printf("删除成功\n");
//        printf("你删除的是:%d\n",val);
//    } else {
//        printf("删除失败\n");
//    }
    inversion_arr(&arr);
    
    show_arr(&arr);
    return 0;
}
Ejemplo n.º 6
0
int main(void)
{
	const int source[LEN1] = {1, 2, 3, 4, 5, 6, 7};
	int target[LEN2];

	copy_arr(source + 2, target, 3);
	show_arr(target, 3);

	return 0;
}
Ejemplo n.º 7
0
int main(void)
{
    int source[LEN] = {5,8,10,6,1,3,7,14,9,4};
    int max_i;

    show_arr(source, LEN);
    max_i = max_index(source, LEN);
    printf("%d = index of largest value of the array.\n", max_i);

    return 0;
}
Ejemplo n.º 8
0
Archivo: 9.c Proyecto: jnksu/CPP
int main(void)
{	
	 int source[4] = {2, 4, 5, 8};
	 int source1[4] = {1, 0, 4, 6};
	
	int target[4];
	
	add_arr(source, source1, target, 4);
	show_arr(target, 4);
	return 0;
}
Ejemplo n.º 9
0
int main(void)
{
    int source[LEN] = {5,8,10,6,1,3,7,14,9,4};
    int max;

    show_arr(source, LEN);
    putchar('\n');
    max = max_val(source, LEN);

    printf("%d = is largest value of the array\n", max);

    return 0;
}
Ejemplo n.º 10
0
Archivo: 8.c Proyecto: jnksu/CPP
int main(void)
{
	const double source[3][5] = {
		{4.4, 5.6, 7.8, 9.3, 7.1},
		{3.8, 6.9, 3.5, 7.0, 2.7},
		{5.9, 7.8, 4.8, 3.0, 5.9}
	};
	double target[3][5];
	
	copy_arr(3, 5, source, target);
	show_arr(3, 5, target);
	return 0;
}
Ejemplo n.º 11
0
int main()
{
	int arr[10];
	cout<<"Please Enter:";
	fflush(stdout);
	for(int i=0;i<10;i++){
		cin>>arr[i];
	}

	//bubble_sort(arr,10);
	//insert_sort(arr,10);
	//shell_sort(arr,10);
	//select_sort(arr,10);
	//select_sort_op(arr,10);
	quick_sort(arr,0,9);
	show_arr(arr,10);
	return 0;
}
Ejemplo n.º 12
0
Archivo: 12.c Proyecto: jnksu/CPP
int main(void)
{
	double stuff[ROWS][COLS];
	int row;
	
	for(row = 0; row < ROWS; row++)
	{
		printf("Enter %d numbers for row %d\n", COLS, row + 1);
		store(*(stuff + row), COLS);
	}
	
	printf("array contents:\n");
	show_arr(stuff, ROWS);
	
	for(row = 0; row < ROWS; row++)
		printf("average value of row %d = %g\n", row + 1, calc_avg(*(stuff + row), COLS));
	printf("average value of all rows = %g\n", calc_all_avg(stuff, ROWS));
	printf("largest value = %g\n", seek_max(stuff, ROWS));
	printf("Bye!\n");
	return 0;
}