C语言键盘输入10个整数计算出他们的平均数并输出
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/08 20:47:35
voidmain(){inta[10];intmax=0;inti;for(i=1;ia[max])max=i;}if(max!=0){i=a[0];a[0]=a[max];a[max]=i;}/*最
#includevoidmain(){\x09intn,i,j,t,a[10000];\x09printf("请输入正整数N:");\x09scanf("%d",&n);\x09printf("请依次
#inlcudevoidmain(){inta[6];inti,j,max=0,sum=0;doubleavg=0.0;printf("请输入六个数:\n");for(i=0;imax)max=a[i
改一个地方就行了#include<stdio.h>int main(){ int a[10]; int i,t,j,m; for
#include "stdio.h"int main(){ int count1=0,count2=0,i;&nbs
#includeintmain(){intarr[20];inti,j,num=0,flag;for(i=0;i
选择法排序:#include"stdio.h"#defineN10voidmain(){inti,j,k,a[N],temp;printf("请输入10个数字:\n");for(i=0;i
#includevoidmain(){intn,i,j,k=0;scanf("%d",&n);printf(“这些数中奇数有:\n");for(i=0;i
#include <stdio.h>#include <iostream>using namespace std;int ma
#include"stdio.h"intmain(intargc,char*argv[]){\x09intarr[10];\x09for(inti=0;i
#includeintmain(void){intcount=0,n,sum=0;whlie(scanf("%d",&n)!=EOF){if(n==-1)break;elsesum+=n;count+
/*输入10个整数(空格隔开):45677123198762339124677123198762339124最大值是:91,索引是:8最小值是:19,索引是:4最大值和最小值交换位置后:4567712
#include"stdio.h"voidmain(){\x09inta[10];\x09inti;\x09intmax,min;\x09for(i=0;i
#include<stdio.h>int main(){\x09int n,i=10,pos=0,neg=0;\x09while(i--)\x09{\x09\x09sc
#includevoidmain(){inta,b,c;intm;printf("Pleaseinputabc\n");scanf("%d%d%d",&a,&b,&c);m=a;if(b>m)m=b;
#include<stdio.h>void main(){ int a[5]={0}; int i,j,t; printf(&q
#include <stdio.h>int main(void){\x09int i, number;\x09for (i =&
#include#includeintmain(){inta[10],n=0,i;for(i=1;i
#include#includeintmain(){\x09inta1,a2,a3,max;\x09scanf("%d",&a1);\x09scanf("%d",&a2);\x09scanf("%d"
#includeintmain(){inta,b,c;printf("Pleaesinput3int:");scanf("%d%d%d",&a,&b,&c);a=(a>=b)?a:b;a=(a>=c)