混凝土强度评定系统1.1 c代码
#define NULL 0
#define LEN 10
#define OK printf("\n此组数据合格。\n")
#define NO printf("\n此组数据不合格!\n")
#define CN printf("\n%30c 伟成工作室荣誉出品 %c\n",17,16)
#include "stdlib.h"
#include "math.h"
static float min,ave;
float *zwfloat(void)
{
float *array,value;
int size,count;
size=LEN;
array=malloc((size+1)*sizeof(float));
if (array==NULL) return NULL;
count=0;
while (scanf("%f",&value),value!=0)
{
if(value<0) continue;
count+=1;
if (count>size)
{
size+=LEN;
array=realloc(array,(size+1)*sizeof(float));
if (array==NULL) return NULL;
}
array[count]=value;
}
if (count<size)
{
array=realloc(array,(count+1)*sizeof(float));
if (array==NULL) return NULL;
}
array[0]=count;
return array;
}
float stdev(float const *p)
{
int i;
float sm=0.0;
ave=0.0;min=p[1];
if (p==NULL) return 0;
for
相关文档:
C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1. fclose函数
fclose函数的功能是关闭一个流,其用法是:int fclose(FILE *stream); 程序例子如下:
#include <string.h& ......
#ifndef _PPC_BOOT_STRING_H_
#define _PPC_BOOT_STRING_H_
#include <stddef.h>
extern char *strcpy(char *dest, const char *src);
extern char *strncpy(char *dest, const char *src, size_t n);
extern char *strcat(char *dest, const char *src);
extern int strcmp(const char *s1, const cha ......
C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1. malloc函数
malloc函数的功能是内存分配函数,其用法为:void *malloc(unsigned size);程序实例如下:
#include <stdio.h>
#i ......
C程序是由一组或是变量或是函数的外部对象组成的。 函数是一个自我包含的完成一定相关功能的执行代码段。下面小编和大家分享下C语言中的函数。
1. normvideo函数
malloc函数的功能是选择正常亮度字符,其用法为:void normvideo(void);程序实例如下:
#include < ......