DEVC++编译问题求助
查看原帖
DEVC++编译问题求助
1636127
freeeeeee楼主2025/2/7 13:21

我的代码如下

#include<bits/stdc++.h>
using namespace std;
typedef long long  ll;
int n,a,b,c;
int main()
{
	cin>>n>>a>>b>>c;
	if(n<=3)
	{
		int m=min(a,b,c);
		if(m==a)
		{
			cout<<"library";
			return 0;
		}
		else if(m==b)
		{
			cout<<"comprehensive";
			return 0;
		}
		else if(m==c)
		{
			cout<<"art";
			return 0;
		}
	}
	else if(n>3)
	{
		if(n<=5)
		{
			int i=min(b,c);
			if(i==b)
			{
				cout<<"comprehensive";
				return 0;
			}
			else if(i==c)
			{
				cout<<"art";
				return 0;
			}
		}
		else if(n>5)
		{
			cout<<"art";
			return 0;
		}
	}
}

编译的时候他弹出来一个程序(2073行,此处不粘贴) 名字叫

/Program Files(x86)/Dev-cpp/MinGW32/include/c++/10.2.0/bits/stl_algobase.h

还给我一个报错 错误部分

  template<typename _Tp, typename _Compare>
    _GLIBCXX14_CONSTEXPR
    inline const _Tp&
    min(const _Tp& __a, const _Tp& __b, _Compare __comp)
    {
      //return __comp(__b, __a) ? __b : __a;
      if (__comp(__b, __a))//<=在此
	return __b;
      return __a;
    }

报错

[Error] '__comp' cannot be used as a function

前面还有个注释

// Core algorithmic facilities -*- C++ -*-

// Copyright (C) 2001-2020 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library.  This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.

// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.

// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.

// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
// <http://www.gnu.org/licenses/>.

/*
 *
 * Copyright (c) 1994
 * Hewlett-Packard Company
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Hewlett-Packard Company makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 *
 *
 * Copyright (c) 1996-1998
 * Silicon Graphics Computer Systems, Inc.
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Silicon Graphics makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
 */

/** @file bits/stl_algobase.h
 *  This is an internal header file, included by other library headers.
 *  Do not attempt to use it directly. @headername{algorithm}
 */

翻译如下

核心算法设施 -- C++ --

版权所有 (C) 2001-2020 自由软件基金会,Inc. 此文件是GNU ISO C++库的一部分。该库是自由软件;你可以根据自由软件基金会发布的通用公共许可证的条款重新发布或修改它,无论是第3版还是(由你选择)任何更新版本。

该库以希望对用户有用的方式分发,但不附带任何形式的保证;没有明示或暗示的商业性或特定目的适用性保证。详情请参阅GNU通用公共许可证。

根据GPL第3版第7节,你被授予额外的权限,这些权限在GCC运行时库例外中描述,版本3.1,由自由软件基金会发布。

你应该随本程序一起收到GNU通用公共许可证和GCC运行时库例外的副本;分别查看COPYING3和COPYING.RUNTIME文件。如果没有,请访问。

版权所有 (c) 1994 惠普公司

特此授权任何个人或机构免费使用、复制、修改、分发和销售本软件及其文档,前提是所有副本均包含上述版权声明,并且本许可通知出现在支持文档中。惠普公司不对本软件的适用性作任何陈述。它按“原样”提供,没有任何明示或暗示的保证。

版权所有 (c) 1996-1998 赛门铁克计算机系统公司

特此授权任何个人或机构免费使用、复制、修改、分发和销售本软件及其文档,前提是所有副本均包含上述版权声明,并且本许可通知出现在支持文档中。赛门铁克不对本软件的适用性作任何陈述。它按“原样”提供,没有任何明示或暗示的保证。

@file bits/stl_algobase.h 这是一个内部头文件,由其他库头文件包含。不要尝试直接使用它。@headername{algorithm}

求助

2025/2/7 13:21
加载中...