long long vs long long int

In C++, "long long" and "long long int" are equivalent and can be used interchangeably. Both represent a 64-bit integer type, capable of storing larger values than the standard "int" or "long" types.

The "long long" type is a shorthand notation introduced in C++ to represent a 64-bit integer, while "long long int" explicitly specifies the type as a 64-bit integer. The "long long" type was introduced to address the need for larger integer values, especially in scenarios where a "long" type might be insufficient.

In practice, both "long long" and "long long int" are widely accepted, and the choice between them is a matter of personal preference or coding style. They are synonymous, and compilers treat them identically when compiling code.

Example:

#include <iostream>

int main() {
    long long num1 = 9223372036854775807LL;  // using "long long"
    long long int num2 = 9223372036854775807LL;  // using "long long int"

    std::cout << "num1: " << num1 << std::endl;
    std::cout << "num2: " << num2 << std::endl;

    return 0;
}