[DTOJ] 2702: remainder, dtoj2702 Remainder

Source: Internet
Author: User

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.