1. #include
  2. using
    namespace
    std;
  3. int
    main( )
  4. {
  5. int
    max(int a,int
    b,int c); //函数声明
  6. double max(double a,double
    b,double c); //函数声明
  7. long
    max(long a,long
    b,long c);//函数声明
  8. int
    i1,i2,i3,i;
  9. cin>>i1>>i2>>i3; //输入3个整数
  10. i=max(i1,i2,i3); //求3个整数中的最大者
  11. cout<<"i_max="<<i<<endl;
  12. double d1,d2,d3,d;
  13. cin>>d1>>d2>>d3; //输入3个双精度数
  14. d=max(d1,d2,d3); //求3个双精度数中的最大者
  15. cout<<"d_max="<<d<<endl;
  16. long
    g1,g2,g3,g;
  17. cin>>g1>>g2>>g3; //输入3个长整数
  18. g=max(g1,g2,g3); //求3个长整数中的最大者
  19. cout<<"g_max="<<g<<endl;
  20. }
  21. int
    max(int a,int
    b,int c) //定义求3个整数中的最大者的函数
  22. {
  23. if(b>a) a=b;
  24. if(c>a) a=c;
  25. return
    a;
  26. }
  27. double max(double a,double
    b,double c)//定义求3个双精度数中的最大者的函数
  28. {
  29. if(b>a) a=b;
  30. if(c>a) a=c;
  31. return
    a;
  32. }
  33. long
    max(long a,long
    b,long c) //定义求3个长整数中的最大者的函数
  34. {
  35. if(b>a) a=b;
  36. if(c>a) a=c;
  37. return
    a;
  38. }

最新文章

  1. sql server中对xml进行操作
  2. iOS 自定义emoji表情键盘
  3. Object -C self -- 笔记
  4. Linux中查看进程及杀死进程命令
  5. 递归——CPS(一)
  6. GlusterFS缺点分析[转]
  7. sharepoint 创建个人网站
  8. JAVA Socket编程(二)之TCP通信
  9. C 上传文件到服务器(含接收端源码)
  10. 【学习】Python进行数据提取的方法总结【转载】
  11. Codeforces Beta Round #64D - Professor&#39;s task
  12. 在ubuntu中我们使用sudo apt-get install 或者dpkg -i *.deb安装软件时,常常提示“有未能满足的依赖关系“,解决方法
  13. 程序员必知的8大排序(二)-------简单选择排序,堆排序(java实现)
  14. 提交给mysql java驱动的优化下个版本要发布了^_^
  15. Linux_Apache 安装
  16. 180716-Centos时区设置
  17. 关于fpga优化的set input delay 和 set output delay
  18. PHP-客户端的IP地址伪造、CDN、反向代理、获取的那些事儿
  19. 购物单问题—WPS使用excel
  20. hadoop27---netty中handler的执行顺序

热门文章

  1. python远程登录Paramiko模块的安装
  2. 20169219《linux内核原理与分析》第七周作业
  3. 每次选中数组中的N条数据, 如果让每条数据被选中的次数做到平均??
  4. ASP.NET MVC实现layui富文本编辑器应用
  5. 百度AI图片识别
  6. Repeater+AspNetPager+Ajax留言板
  7. ldap第一天 编译安装LDAP + ldapadmin
  8. java中静态代码块的用法 static用法详解和static静态导入
  9. Spring ThreadPoolTaskExecutor队列满的异常处理
  10. Eclipse进行Java web开发时,可能会出现这样的错误:The superclass javax.servlet.http.HttpServlet was not found on the Java Build Path