搜索
查看: 201|回复: 2
打印 上一主题 下一主题

无法运行哪里的问题啊

[复制链接]
跳转到指定楼层
楼主
 楼主| 发表于 2020-2-17 00:20:41 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
5啊哈币
  1. #include <iostream>
  2. #include <cstdio>
  3. using namespace std;
  4. int main()
  5. {
  6.     int a,b;
  7.     scanf("%d%d",&a,&b);
  8.     printf("%d大",int max(a,b));
  9.     return 0;
  10. }

  11. int (int x,int y){
  12.     if(x>y)
  13.     retun x;
  14.     else
  15.     retun y;
  16. }
复制代码

沙发
发表于 2020-2-17 13:04:08 | 只看该作者
retun错了,应是return
板凳
发表于 2020-2-21 16:01:16 | 只看该作者
不止return错了,正确代码:
#include <iostream>
#include <cstdio>
using namespace std;
int max (int x,int y){
    if(x>y)
    return x;
    else
    return y;
}
int main(){
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d大",max(a,b));
    return 0;
}
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

广播台
特别关注
快速回复 返回顶部 返回列表