mirror of
https://github.com/Comp211-SP24/lab-02-Rushilwiz.git
synced 2025-04-09 14:50:19 -04:00
formatted files
This commit is contained in:
parent
7ef18644e8
commit
5de9838a15
|
@ -1,8 +1,8 @@
|
|||
// PID: 730677144
|
||||
// I pledge the COMP 211 honor code.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
|
@ -21,7 +21,8 @@ int main(int argc, char *argv[]) {
|
|||
int carry = 1;
|
||||
for (int i = 31; i >= 0 && carry; i--) {
|
||||
output[i] = (input[i] == '0') ? '1' : '0';
|
||||
if (input[i] == '0') carry = 0;
|
||||
if (input[i] == '0')
|
||||
carry = 0;
|
||||
}
|
||||
} else {
|
||||
int i = 31;
|
||||
|
|
2
signed.c
2
signed.c
|
@ -1,8 +1,8 @@
|
|||
// PID: 730677144
|
||||
// I pledge the COMP 211 honor code.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int num = atoi(argv[1]);
|
||||
|
|
3
twos.c
3
twos.c
|
@ -1,8 +1,8 @@
|
|||
// PID: 730677144
|
||||
// I pledge the COMP 211 honor code.
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
int num = abs(atoi(argv[1]));
|
||||
|
@ -20,7 +20,6 @@ int main(int argc, char *argv[]) {
|
|||
} else {
|
||||
out[15 - i] = '0';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (argv[1][0] == '-') {
|
||||
|
|
Loading…
Reference in New Issue
Block a user