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开发者_如何学Python;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; }
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.
I was going to say it was a trigraph operator, but it isn't even that. It's probably a typo.
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.
精彩评论