C++ 中的
发布于 2024-11-07 07:11:29 字数 1915 浏览 2 评论 0 原文

可能的重复:
>?= 运算符是什么意思?

我想知道 运算符我一直在 C++ 代码中看到。它无法在我的系统上编译,但我确信它是正确的。它的用法如下:a

另外,我需要做什么才能编译它?

编辑帖子:

请参阅此源代码(它是实践获胜者的问题 Square Fields(问题 B)的解决方案 Google Code Jam 竞赛 - 请参阅 此处)。我在其他一些提交的内容中也看到了相同的字符模式。

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<numeric>
#include<cmath> using namespace std;

#define ALL(t) t.begin(),t.end()
#define FOR(i,n) for (int i=0; i<(int)(n); i++)
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) typedef vector<int> vi; typedef long long int64;

int t[15][1<<15]; int main() {   int N;cin>>N;   for(int c=1;c<=N;c++){
    int n,k,x[30],y[30];
    cin>>n>>k;
    FOR(i,n)cin>>x[i]>>y[i];
    FOR(take,1<<n)if(take){
      int minx=1000000,maxx=-1,miny=1000000,maxy=-1;
      FOR(i,n)if(take&1<<i)minx<?=x[i],maxx>?=x[i],miny<?=y[i],maxy>?=y[i];
      t[1][take]=(maxx-minx)>?(maxy-miny); //      cout<<take<<" "<<t[1][take]<<endl;
    }
    for(int kk=2;kk<=k;kk++)FOR(take,1<<n){
      t[kk][take]=t[kk-1][take];
      for(int take2=take;take2;take2=(take2-1)&take)
        t[kk][take]<?=t[kk-1][take-take2]>?t[1][take2];
    }
    cout<<"Case #"<<c<<": "<<t[k][(1<<n)-1]<<endl;   }   return 0; }

Possible Duplicate:
What does the >?= operator mean?

I was wondering what is the <?= operator I keep seeing in C++ code. It doesn't compile on my system, but I'm sure it is correct. It's used like this:a <?= something;

Also, what would I need to do to be able to compile it?

EDIT POST:

Please see this source code (it is a solution of the problem Square Fields (Problem B) of the winner of a practice Google Code Jam contest -- see here). I saw the same pattern of characters in some other submissions too.

#include<cstdio>
#include<algorithm>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<numeric>
#include<cmath> using namespace std;

#define ALL(t) t.begin(),t.end()
#define FOR(i,n) for (int i=0; i<(int)(n); i++)
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) typedef vector<int> vi; typedef long long int64;

int t[15][1<<15]; int main() {   int N;cin>>N;   for(int c=1;c<=N;c++){
    int n,k,x[30],y[30];
    cin>>n>>k;
    FOR(i,n)cin>>x[i]>>y[i];
    FOR(take,1<<n)if(take){
      int minx=1000000,maxx=-1,miny=1000000,maxy=-1;
      FOR(i,n)if(take&1<<i)minx<?=x[i],maxx>?=x[i],miny<?=y[i],maxy>?=y[i];
      t[1][take]=(maxx-minx)>?(maxy-miny); //      cout<<take<<" "<<t[1][take]<<endl;
    }
    for(int kk=2;kk<=k;kk++)FOR(take,1<<n){
      t[kk][take]=t[kk-1][take];
      for(int take2=take;take2;take2=(take2-1)&take)
        t[kk][take]<?=t[kk-1][take-take2]>?t[1][take2];
    }
    cout<<"Case #"<<c<<": "<<t[k][(1<<n)-1]<<endl;   }   return 0; }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

疯狂的代价 2024-11-14 07:11:29

编辑:

它是旧版本 GCC 的扩展。请参阅:

>?= 运算符是什么意思?

但是扩展是>? 。我仍然没有看到

6.1 C++ 中的最小和最大运算符


早期帖子:

我向你保证,C++ 中没有这样的运算符。这肯定是一个打字错误。

程序员很可能想要输入 <=?:

或者您可能在这里输入错误,而实际上您打算输入 二合字母或三合字母(但您输入的内容既不是二合字母,也不是三字母)。

正如您自己所说它无法在我的系统上编译。会怎样呢?这是一个错字。

EDIT:

Its an extension in older versions of GCC. See this :

What does the >?= operator mean?

But then the extensions are <? and >? . I still don't see <?=.

6.1 Minimum and Maximum Operators in C++


EARLIER POST:

I assure you, there is no such operator in C++. Its certainly a mistyping.

The programmer most likely wanted to type either <= or ?:

Or maybe you mistyped it here when in fact you intended to type a digraph or trigraph (but what you've typed is neither digraph nor trigraph).

As you yourself said it doesn't compile on my system. How would it? Its a typo.

绮烟 2024-11-14 07:11:29

我本来想说这是一个三字母运算符,但事实并非如此。这可能是一个错字。

I was going to say it was a trigraph operator, but it isn't even that. It's probably a typo.

柠檬色的秋千 2024-11-14 07:11:29

您是否可能与这个运算符混淆了:a?乙:丙。
否则,请发布您在其中看到的一些代码的链接,因为它肯定不是普通的 C++。
它可能是另一种语言,但谷歌搜索它实际上什么也没有返回,所以我不认为这就是答案。

Is it possible that you are getting mixed up with this operator: a ? b : c.
Otherwise, please post a link to some of the code that you've seen it in, because it sure ain't normal c++.
It could be another language, but googling it returns literally nothing, so I don't think that's the answer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文