Home > Back-end > C, why to prove that two integers a and b are equal, can't write a % b==0
C, why to prove that two integers a and b are equal, can't write a % b==0
Time:10-13
Output an integer sequence with a specified number of the same number, the number of the input contains 2 lines: 1 N and m, according to the sequence of integers length (N 100) or less, and the specified number; Act 2 N integers, integers separated with a space between the output for the number of N and m the number of the same number,
[enter] 1 N and m, said the sequence of integers length (N 100) or less, and the specified number, separated by a space;
Act 2 N integers, integers separated with a space between,
CodePudding user response:
10 is equal to 5? But 10% 5 equal to zero
CodePudding user response:
A % b==0 means a aliquot b, can't judge a must be equal to b, such as 4 can be divided exactly by 2, 4 but not equal to 2 Whether two integer equal, direct==ok, a==b
CodePudding user response:
Good?? Thank you for the
CodePudding user response:
Can be used to determine two equal Numbers, but with a large number to beg, so, to write the if (a CodePudding user response: (a % b==0 & amp; & A/b==1), for this I do not know can not
The same a ^ b==0
CodePudding user response:
Lin2 zi3 da4 shrimp bird all have, so, just to verify, Int a=2, b=4; cout <((a & lt; B? A % b: b %)==0) & lt;