我已经使用本网站上的说明安装了GMP:http://www.cs.nyu.edu/exact/core/gmp/ 然后我找了一个使用该库的示例程序:
#include <iostream>
#include <gmpxx.h>
using namespace std;
int main (void) {
mpz_class a, b, c;
a = 1234;
b = "-5678";
c = a+b;
cout << "sum is " << c << "\n";
cout << "absolute value is " << abs(c) << "\n";
cin >> a;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但是如果我使用以下命令编译它:g ++ test.cpp -o test.exe,它说gmpxx.h:没有这样的文件或目录.我怎样才能解决这个问题?我对此很陌生.我正在使用MinGW.
我想制作程序,分析程序用户编写的文本的每个字母.例如,某人键入"你好".有没有办法将所有这些字母放在某个数组中?例如,myArray [0] = h,myArray [1] = e,...谢谢
我有一个数组:
int array[5];
Run Code Online (Sandbox Code Playgroud)
我将使用此数组在其中添加一些值.现在我的问题是:如何在填写一些数字后检查阵列中是否填充了某些内容?谢谢