bshy.net
当前位置:首页>>关于C语言题目.编写一main函数,实现以下功能,定义含...的资料>>

C语言题目.编写一main函数,实现以下功能,定义含...

#includeint main(){ int a[6]; int i; double sum=0,avg; for(i = 0;i < 6;i++){ scanf("%d",&a[i]); sum += a[i]; } avg = sum/6; printf("sum = %.0lf average = %.1lf\n",sum,avg); return 0;}

void main() { int input[10]; int c=0; while(c

#include #define N 10void delete_max(int a[]){ int i, m; m = 0; for(i=1;i

#include void main() {int i,j,a[8]; int t; for(i=0;i

#include #include #include #include #define LEN 100 /*数组长度上限*/#define elemType float /*元素类型*//*float数组每个元素均截断小数部分*/void arrFloatToInt (elemType arr[], int len) {int i;for (i=0; i

#include void swap(int *a,int *b) { int t; t = *a; *a = *b; *b = t; } void main () { int a,b,c; scanf("%d%d%d",&a,&b,&c); if(a

试试.. #define N 10 #include void main() { void sr(int a[]); void sc(int a[],int m); void js(int a[],int *max,int *min); void px(int a[]); int a[N],m,max,min; /***************************/ printf("输入一个数m "); scanf("%d",&m)...

#include#define Pi 3.14159double Square(double r){ return Pi * r * r;}double Perimeter(double r){ return 2 * Pi * r;}int main(){ double r; printf("请输入圆的半径:\n"); while(scanf("%lf",&r)!= EOF){ printf("圆的面积是%lf\n",Squ...

#include //主函数在后,头文件要在前void prime(int a){int m;for(m=2;m

#includeint main(){int data[20]={1,1};int i,sum=2;double ave;for(i=2;i

网站首页 | 网站地图
All rights reserved Powered by www.bshy.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com