[DTOJ] 2702: remainder, dtoj2702 Remainder
DTOJ 2702: Report on solving the remainder Problem
- 2017.11.09 First Edition--CoolOriginal
Question information:Description
Enter two integers to calculate the remainder of their division.
Input
A and B
Output
Remainder of a/B
Sample Input
3 2
Sample output
1
Ideas:
To calculate the remainder, the modulo operation (remainder operation) "%" is required. Note that the data on both sides of % must be an integer int.
Note:
A and B must be declared as integer int variables.
My code (C ++ ):
1 // DTOJ 2702 2 # include <iostream> 3 using namespace std; 4 5 int main () 6 {7 int a, B; 8 cin> a> B; 9 cout <a % B; 10 return 0; 11}
Expansion:
For details about the modulo operation, refer to Baidu encyclopedia.
This work is licensed using the knowledge sharing signature-non-commercial use-share the 4.0 international license agreement in the same way.
-- Qoreng's Funny match w