热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_53831632
long shotPT
5 年前
trueweixin_53831632

后续ing

#include<stdio.h>
#include<stdlib.h>
typedef struct NODE{
int x;
struct NODE*nextptr;
}node;
node *headptr,*currentptr,*lastptr;
int main()
{
int num,max,min,sum;
sum=0;
headptr=NULL;
scanf("%d",&num);
max=num;
min=num;
while(num!=-1){
currentptr=(node*)malloc(sizeof(node));
if(currentptr!=NULL){
currentptr->x=num;
sum=sum+num;
if(num>max)
max=num;
else if(num<min)
min=num;
}
if(headptr=NULL){
headptr=currentptr;
}
scanf("%d",&num);
}
printf("The maximum,minmum and the total are:%d %d %d",max,min,sum);
return 0;
}

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
因为对大数据分析感兴趣,想学习python,零基础,各位同学和大神们,有推荐的书籍或者网站吗?
立即登录