从键盘输入若干数,输入0时结束.求其中最大数和最小数.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/18 03:56:55
运行通过,有问题HI:#includeintmain(){intnum,n=0,m=0;do{scanf("%d",&num);if(num>0)m++;elseif(num
intmax;//接收最大值intarr[n];//n为输入的整数的个数inti;max=arr[0];for(i=0;imax)max=arr[i];//求最大值}这是核心语句,我希望你可以自己加上
#include<stdio.h>int main(){\x09int in;\x09int max = -100, min&n
/>1#include#includeintmain(){intx=0;while(1){printf("请输入x值:");scanf("%d",&x);if(x==0){break;}printf(
#include "stdio.h"int main(){ int count1=0,count2=0,i;&nbs
#include<iostream>usingnamespacestd;intmain(){ cout&l
#include#defineN30typedefstructstudent{\x09charname[10];\x09intscore;}STU;voidmain(){\x09STUs[N];\x0
上一个你还没采纳呢1)intmax=0;intn;do{scanf("%d",&n);if(max再问:采纳了亲再答:第一个刚修改了第二有稍复杂点,先吃饭去。再问:谢了哈再答:回来了第二个给你补上:主
#includeintmain(void){intmax=0;while(1){intnum=0;scanf("%d",&num);if(num==0)break;max=num>maxnum:max
PrivateSubForm_Click()DimsAsInteger,maxAsInteger,minAsInteger,nAsInteger,averageAsSingle,sumAsLongDo
#include<stdio.h>#define N 1000int main(){ int a[N]={0},i=0,j=2,h=1,k
#includeintmain(void){intcount=0,n,sum=0;whlie(scanf("%d",&n)!=EOF){if(n==-1)break;elsesum+=n;count+
用C语言吗再问:是的再答:#includeintmain(){inta=0,sum[4]={0,0,0,0};do{scanf("%d",&a);if(a==1)sum[0]++;if(a==2)su
#includevoidmain(){intn=0;floatx,sum=0,aver=0;scanf("%f",&x);n++;while(x!=-1){sum+=x;n++;scanf("%f",
#include#includeintmain(){inta,sum=0;do{scanf("%d",&a);if((a/100)%10==3)sum+=a;}while(a!=0);printf("
#includevoidmain(){intmax(intx,inty;inta,b,c;scanf("%d,%d",&a,&b);c=max(a,b);printf("Thelargestnumbe
#includevoidmain(){intn,i;intmax;intmin;n=1;for(i=1;n!=0;i++){scanf("%d",&n);if(i==1){min=max=n;}if(
data=[];%初始数据为空in=input('输入:');%输入一个数据while(isempty(in)||in~=0)%空数据或者数据不为0进入循环,数据为0跳出循环data=[datain]
#includeintmain(){intx=0;inti=0;intsum=0;\x05while(1)\x05{\x05\x05printf("输入正整数:\n");\x05\x05\x05sca