35: output binary complement, 35 binary Complement

Source: Internet
Author: User

35: output binary complement, 35 binary Complement
35: output binary Complement

  • View
  • Submit
  • Statistics
  • Question
Total time limit:
1000 ms
Memory limit:
65536kB
Description

Enter an integer (int) and output its 32-bit binary complement.

Input
An integer.
Output
Output a line, that is, the complement representation of the integer.
Sample Input
7
Sample output
00000000000000000000000000000111'

1 # include <iostream> 2 # include <cstdio> 3 using namespace std; 4 int a [10001]; 5 int now; 6 int main () 7 {8 int n; 9 cin> n; 10 for (int I = 31; I> = 0; I --) 11 {12 cout <(n> I) & 1 ); 13} 14 return 0; 15}

 

Related Article

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.