#include<iostream>
using namespace std;
int main(void) {
cout << -21 % -5 << endl;
//将会输出-1
cout << -21 % 5 << endl;
//将会输出-1
cout << 21 % -5 << endl;
//将会输出1
return 0;
}
C++负数余负数
最新推荐文章于 2023-10-08 12:43:26 发布
#include<iostream>
using namespace std;
int main(void) {
cout << -21 % -5 << endl;
//将会输出-1
cout << -21 % 5 << endl;
//将会输出-1
cout << 21 % -5 << endl;
//将会输出1
return 0;
}