小编Aj *_*son的帖子

C中双精度数组的优化和

我有一个任务,我必须采取一个程序,并使其在时间上更有效.原始代码是:

#include <stdio.h>
#include <stdlib.h>

// You are only allowed to make changes to this code as specified by the comments in it.

// The code you submit must have these two values.
#define N_TIMES     600000
#define ARRAY_SIZE   10000

int main(void)
{
    double  *array = calloc(ARRAY_SIZE, sizeof(double));
    double  sum = 0;
    int     i;

    // You can add variables between this comment ...
    long int help;
    // ... and this one.

    // Please change 'your name' to your actual name.
    printf("CS201 …
Run Code Online (Sandbox Code Playgroud)

c optimization performance for-loop

-6
推荐指数
1
解决办法
4104
查看次数

标签 统计

c ×1

for-loop ×1

optimization ×1

performance ×1