这里为啥显示标识符未标识?
public class test {
public static void main(String[] args) {
int r1 = 9;
long long r2 = 9;
}
}
java? java没有 long long,c++才有
用 BigInteger 代替,用法你 google 下,更好用
你好。Java中想要使用long long类型职能相同的类型,应该是使用BigInetger
,具体如下:
import java.math.BigInteger;
public class test {
public static void main(String[] args) {
int r1 = 9;
BigInteger r2 = new BigInteger("9");
}
}
应该是
long r2 = 9;
public class test {
public static void main(String[] args) {
int r1 = 9;
long r2 = 9;
}
}
#include <iostream>
#include <algorithm> // 头文件
using namespace std;
int main()
{
int n = 8;
int A[] = {1, 3, 5, 7, 9, 11, 13, 15};
cout<<binary_search(A, A + n, 9)<<endl;
return 0;
}
上述代码中,查找数组 A 中是否存在 9,输出结果为 1。