Skip to content

Instantly share code, notes, and snippets.

@nbarnold01
Created November 1, 2015 12:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nbarnold01/227f37ce4554c8d5183e to your computer and use it in GitHub Desktop.
Save nbarnold01/227f37ce4554c8d5183e to your computer and use it in GitHub Desktop.
//
// main.m
// Flipping Bits
//
// Created by Nathan Arnold on 11/1/15.
// Copyright © 2015 Nathan Arnold. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
// insert code here...
int length = 0;
scanf("%d",&length);
for (int i =0; i< length; i++){
unsigned num = 0;
scanf("%u",&num);
//bitwise NOT
printf("%u\n",~num);
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment