以下のコードのように
unsigned で宣言すると必ず正の数になる。
バグの発見に時間がかかってしまった。
typedef unsigned long long ull;
int main()
{
ull a = 10;
if (a - 100 >= 0) {
cout << "Yes" << endl;
}
}
Go to list of users who liked
Share on X(Twitter)
Share on Facebook
More than 3 years have passed since last update.
以下のコードのように
unsigned で宣言すると必ず正の数になる。
バグの発見に時間がかかってしまった。
typedef unsigned long long ull;
int main()
{
ull a = 10;
if (a - 100 >= 0) {
cout << "Yes" << endl;
}
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked