File tree Expand file tree Collapse file tree 4 files changed +47
-2
lines changed
programming/2023/rework/hw02 Expand file tree Collapse file tree 4 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 1+ #include "tideman.h"
2+
3+ int main (int argc , string argv [])
4+ {
5+
6+
7+
8+ return 0 ;
9+ }
Original file line number Diff line number Diff line change 1+ #pragma once
2+
3+ // libraries
4+ #include <stdio.h>
5+ #include <stdint.h>
6+ #include <stdlib.h>
7+ #include <string.h>
8+
9+ // macro constants
10+ #define MAX 9
11+
12+ // function prototypes
13+ bool vote (int rank , string name , int ranks []);
14+ bool cycle_pairs (int start , int endCase );
15+ void record_preferences (int ranks []);
16+ void add_pairs (void );
17+ void sort_pairs (void );
18+ void lock_pairs (void );
19+ void print_winner (void );
20+
21+ // global variables cause cs50 is kinda cringe
22+ int32_t preferences [MAX ][MAX ];
23+ bool locked [MAX ][MAX ];
24+ int32_t pair_count ;
25+ int32_t candidate_count ;
26+
27+ // structs
28+ typedef struct
29+ {
30+ int32_t winner ;
31+ int32_t loser ;
32+ }
33+ pair ;
34+
35+ string candidates [MAX ];
36+ pair pairs [MAX * (MAX - 1 ) / 2 ];
Original file line number Diff line number Diff line change 11#include "myIrrational.h"
2- // driver code
2+
33int main (){
44
55 uint16_t n = getNum ();
66
77 menu (n );
88
99 return 0 ;
10- }
10+ }
You can’t perform that action at this time.
0 commit comments