#include <iostream>
using namespace std;
int main()
{
cout << "long long" << sizeof(long long) << endl;
cout << "long" << sizeof(long) << endl;
cout << "int" << sizeof(int) << endl;
int n1 = 8998211;
int n2 = 299;
long long n3 = n1 * n2;
cout << n3 << endl;
return 0;
}
以上代码输出
long long8
long8
int4
-1604502207
n1,n2都无64位的则要写成
long long n3 = (long long)n1* (long long)n2;