windows 回车,ctrl z 再回车结束,linux 下ctrl D 结束

来源:互联网 发布:哥特式字体软件 编辑:程序博客网 时间:2024/06/07 05:54

/*
  Name:
  Copyright:
  Author: 
  Date:
  Description:未知个数的多个整数,求个数 和最大值
*/
#include<stdio.h>
#include<stdlib.h>

int main()
{
    int i,maxi,temp;
     i=0;
      while(scanf("%d",&temp)!=EOF)
      { 
                                    if(i==0)
                                       maxi=temp;
                                        else   if
                                        (temp>maxi)   maxi=temp;
                                         i++;
                                          }
                                          printf("%d %d/n",i,maxi);
                                         


system("pause");
return 0;
}
0; }

原创粉丝点击