我在代码中看到了 = 的用法:http://community.topcoder.com/stat?c=problem_solution&rm=151152&rd=5854&pm=2923&cr=310333
我尝试了一下不包含它们的编译,以测试它是否是标准的,但却失败了。之后我添加了这些内容,但仍然出现同样的错误:
以下是链接中代码中对它的使用方式:
我该如何让这个工作起来?
question-mark.cpp:15:5: error: expected primary-expression before ‘?’ token question-mark.cpp:15:6: error: expected primary-expression before ‘=’ token question-mark.cpp:15:9: error: expected ‘:’ before ‘;’ token question-mark.cpp:15:9: error: expected primary-expression before ‘;’ token
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
int main()
{
int x = 3;
int y = 2;
x >?= y;
printf("x = %d\n", x);
return 0;
}
以下是链接中代码中对它的使用方式:
x <?= h[i][j]; // x = (h[i][j] < x) ? h[i][j] : x;
我该如何让这个工作起来?