编写的C++ 程序大家看哈那里错了 钱少大家帮帮忙噶

[复制链接]
查看11 | 回复3 | 2011-6-25 15:55:49 | 显示全部楼层 |阅读模式
// 123.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
int max(int a, int b)
{
        int temp;

if (a>b)
                temp=a;
        else
                temp=b;
        return temp;
}
int main(int argc, char* argv[])
{
        int x,y;

scanf("%d %d,&x,&y);

int result=max(x, y);

printf("max=%d\n, result");
        return 1;
}

回复

使用道具 举报

千问 | 2011-6-25 15:55:49 | 显示全部楼层
#include "stdio.h"int max(int a, int b){int temp;
if (a>b)temp=a;elsetemp=b;return temp;}int main(int argc, char* argv[]){ int x,y;
scanf("%d %d",&x,&y);
int result=max(x, y);
printf("max=%d\n", result);return 1;}你的头文件和几个地方的引号弄错了...
回复

使用道具 举报

千问 | 2011-6-25 15:55:49 | 显示全部楼层
代码没问题,是从哪里copy过来直接编译的吧。好像是环境有问题...
回复

使用道具 举报

千问 | 2011-6-25 15:55:49 | 显示全部楼层
代码没有错,估计是你设置出问题了 Defines the entry point for the console application...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行