大数据平台技术框架支持的开发语言多种多样,开发人员的背景差异也很大,这就产生出很多不同类型的程序(任务)运行在大数据平台之上,如:MapReduce、Hive、Pig、Spark、Java、Shell、Python等。
參考代碼:
#include <stdio.h>
#include<iostream>
#include<malloc.h>
using namespace std;
void shellsort( long *a, long n );
int main()
double r[100]; /*
用来存放每个测试案例的计算结果
*/
j=0; /*
记录测试案例的个数
*/
for(
对每一个测试案例
)
{
把计算机得到的最优调度时间存入
r[j]
中;
j++;
}
/*
当输入的
n
值为负数时,跳出上面的
for
循环
*/
for(
从
0
到
j)
{
if(r[i]==-1)printf(
“
\n
”
); /*
输出一个空行
*/
else printf(
“
%. 2f\n
”
,r[i]); /*
输出的结果要求精确到
0.01*/
}
{
long n,i,j;
long *a,*b;
double r[100];/****
用来存放每个测试案例的计算结果
***/
j=0;/***
记录测试案例的个数
***/
/*****
读入用户的输入,若当前输入为负数,则程序终止
******/
for( n = 0; n >= 0 )
{
scanf( "%ld", &n );
if(n > 2000000){
printf("too much for the project!\n");
exit(0);
}
if( n > 0 )
{
b = (long*)malloc( n * sizeof( long ) );
a = b;
for(i=0; i< n i++)
{
scanf( "%ld", b+i );
/***
检查输入的数据是否大于
1000 000 000****/
11
if(*(b+i) > 1000000000){
printf("too much for the project!\n");
exit(0);
}
/***
对输入中出现任务时间为负数的异常处理
******/
if(*(b+i)<0)
{
printf("input error
!
\n");
return 0;
}
}
shellsort( b, n );
/*****
计算平均完成时间
*****/
for( i = n, r[j] = 0.0; i > 0 i--,a++ )
{
r[j]+= (double)*a/(double)n * i;
}
j++;
free( b );
}
/***
当
n
为
0
时,标志相应的
r
数组值为-
1
,输出时碰到-
1
则输出一个空
Hadoop|
Apache Pig|
Apache Kafka|
Apache Storm|
Impala|
Zookeeper|
SAS|
TensorFlow|
人工智能基础|
Apache Kylin|
Openstack|
Flink|
MapReduce|
大数据|
云计算|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....