From 7dbdec1694a1b4c64dca016adb11ad099e73fc55 Mon Sep 17 00:00:00 2001 From: wangfiox Date: Sun, 2 Jun 2024 22:04:54 +0800 Subject: [PATCH] add include --- final_performance_c/sy/01_mm1.sy | 1 + final_performance_c/sy/01_mm2.sy | 1 + final_performance_c/sy/01_mm3.sy | 1 + final_performance_c/sy/03_sort1.sy | 1 + final_performance_c/sy/03_sort2.sy | 1 + final_performance_c/sy/03_sort3.sy | 1 + final_performance_c/sy/04_spmv1.sy | 1 + final_performance_c/sy/04_spmv2.sy | 1 + final_performance_c/sy/04_spmv3.sy | 1 + final_performance_c/sy/fft0.sy | 1 + final_performance_c/sy/fft1.sy | 1 + final_performance_c/sy/fft2.sy | 1 + final_performance_c/sy/gameoflife-gosper.sy | 1 + final_performance_c/sy/gameoflife-oscillator.sy | 1 + final_performance_c/sy/gameoflife-p61glidergun.sy | 1 + final_performance_c/sy/if-combine1.sy | 1 + final_performance_c/sy/if-combine2.sy | 1 + final_performance_c/sy/if-combine3.sy | 1 + final_performance_c/sy/large_loop_array_1.sy | 1 + final_performance_c/sy/large_loop_array_2.sy | 1 + final_performance_c/sy/large_loop_array_3.sy | 1 + final_performance_c/sy/matmul1.sy | 1 + final_performance_c/sy/matmul2.sy | 1 + final_performance_c/sy/matmul3.sy | 1 + final_performance_c/sy/recursive_call_1.sy | 1 + final_performance_c/sy/recursive_call_2.sy | 1 + final_performance_c/sy/recursive_call_3.sy | 1 + final_performance_c/sy/shuffle0.sy | 1 + final_performance_c/sy/shuffle1.sy | 1 + final_performance_c/sy/shuffle2.sy | 1 + final_performance_c/sy/sl1.sy | 1 + final_performance_c/sy/sl2.sy | 1 + final_performance_c/sy/sl3.sy | 1 + final_performance_c/sy/transpose0.sy | 1 + final_performance_c/sy/transpose1.sy | 1 + final_performance_c/sy/transpose2.sy | 1 + functional_c/sy/00_main.sy | 1 + functional_c/sy/01_var_defn2.sy | 1 + functional_c/sy/02_var_defn3.sy | 1 + functional_c/sy/03_arr_defn2.sy | 1 + functional_c/sy/04_arr_defn3.sy | 1 + functional_c/sy/05_arr_defn4.sy | 1 + functional_c/sy/06_const_var_defn2.sy | 1 + functional_c/sy/07_const_var_defn3.sy | 1 + functional_c/sy/08_const_array_defn.sy | 1 + functional_c/sy/09_func_defn.sy | 1 + functional_c/sy/10_var_defn_func.sy | 1 + functional_c/sy/11_add2.sy | 1 + functional_c/sy/12_addc.sy | 1 + functional_c/sy/13_sub2.sy | 1 + functional_c/sy/14_subc.sy | 1 + functional_c/sy/15_mul.sy | 1 + functional_c/sy/16_mulc.sy | 1 + functional_c/sy/17_div.sy | 1 + functional_c/sy/18_divc.sy | 1 + functional_c/sy/19_mod.sy | 1 + functional_c/sy/20_rem.sy | 1 + functional_c/sy/21_if_test2.sy | 1 + functional_c/sy/22_if_test3.sy | 1 + functional_c/sy/23_if_test4.sy | 1 + functional_c/sy/24_if_test5.sy | 1 + functional_c/sy/25_while_if.sy | 1 + functional_c/sy/26_while_test1.sy | 1 + functional_c/sy/27_while_test2.sy | 1 + functional_c/sy/28_while_test3.sy | 1 + functional_c/sy/29_break.sy | 1 + functional_c/sy/30_continue.sy | 1 + functional_c/sy/31_while_if_test1.sy | 1 + functional_c/sy/32_while_if_test2.sy | 1 + functional_c/sy/33_while_if_test3.sy | 1 + functional_c/sy/34_arr_expr_len.sy | 1 + functional_c/sy/35_op_priority1.sy | 1 + functional_c/sy/36_op_priority2.sy | 1 + functional_c/sy/37_op_priority3.sy | 1 + functional_c/sy/38_op_priority4.sy | 1 + functional_c/sy/39_op_priority5.sy | 1 + functional_c/sy/40_unary_op.sy | 1 + functional_c/sy/41_unary_op2.sy | 1 + functional_c/sy/42_empty_stmt.sy | 1 + functional_c/sy/43_logi_assign.sy | 1 + functional_c/sy/44_stmt_expr.sy | 1 + functional_c/sy/45_comment1.sy | 1 + functional_c/sy/46_hex_defn.sy | 1 + functional_c/sy/47_hex_oct_add.sy | 1 + functional_c/sy/48_assign_complex_expr.sy | 1 + functional_c/sy/49_if_complex_expr.sy | 1 + functional_c/sy/50_short_circuit.sy | 1 + functional_c/sy/51_short_circuit3.sy | 1 + functional_c/sy/52_scope.sy | 1 + functional_c/sy/53_scope2.sy | 1 + functional_c/sy/54_hidden_var.sy | 1 + functional_c/sy/55_sort_test1.sy | 1 + functional_c/sy/56_sort_test2.sy | 1 + functional_c/sy/57_sort_test3.sy | 1 + functional_c/sy/58_sort_test4.sy | 1 + functional_c/sy/59_sort_test5.sy | 1 + functional_c/sy/60_sort_test6.sy | 1 + functional_c/sy/61_sort_test7.sy | 1 + functional_c/sy/62_percolation.sy | 1 + functional_c/sy/63_big_int_mul.sy | 1 + functional_c/sy/64_calculator.sy | 1 + functional_c/sy/65_color.sy | 1 + functional_c/sy/66_exgcd.sy | 1 + functional_c/sy/67_reverse_output.sy | 1 + functional_c/sy/68_brainfk.sy | 1 + functional_c/sy/69_expr_eval.sy | 1 + functional_c/sy/70_dijkstra.sy | 1 + functional_c/sy/71_full_conn.sy | 1 + functional_c/sy/72_hanoi.sy | 1 + functional_c/sy/73_int_io.sy | 1 + functional_c/sy/74_kmp.sy | 1 + functional_c/sy/75_max_flow.sy | 1 + functional_c/sy/76_n_queens.sy | 1 + functional_c/sy/77_substr.sy | 1 + functional_c/sy/78_side_effect.sy | 1 + functional_c/sy/79_var_name.sy | 1 + functional_c/sy/80_chaos_token.sy | 1 + functional_c/sy/81_skip_spaces.sy | 1 + functional_c/sy/82_long_func.sy | 1 + functional_c/sy/83_long_array.sy | 1 + functional_c/sy/84_long_array2.sy | 1 + functional_c/sy/85_long_code.sy | 1 + functional_c/sy/86_long_code2.sy | 1 + functional_c/sy/87_many_params.sy | 1 + functional_c/sy/88_many_params2.sy | 1 + functional_c/sy/89_many_globals.sy | 1 + functional_c/sy/90_many_locals.sy | 1 + functional_c/sy/91_many_locals2.sy | 1 + functional_c/sy/92_register_alloc.sy | 1 + functional_c/sy/93_nested_calls.sy | 1 + functional_c/sy/94_nested_loops.sy | 1 + functional_c/sy/95_float.sy | 1 + functional_c/sy/96_matrix_add.sy | 1 + functional_c/sy/97_matrix_sub.sy | 1 + functional_c/sy/98_matrix_mul.sy | 1 + functional_c/sy/99_matrix_tran.sy | 1 + hidden_functional_c/sy/00_comment2.sy | 1 + hidden_functional_c/sy/01_multiple_returns.sy | 1 + hidden_functional_c/sy/02_ret_in_block.sy | 1 + hidden_functional_c/sy/03_branch.sy | 1 + hidden_functional_c/sy/04_break_continue.sy | 1 + hidden_functional_c/sy/05_param_name.sy | 1 + hidden_functional_c/sy/06_func_name.sy | 1 + hidden_functional_c/sy/07_arr_init_nd.sy | 1 + hidden_functional_c/sy/08_global_arr_init.sy | 1 + hidden_functional_c/sy/09_BFS.sy | 1 + hidden_functional_c/sy/10_DFS.sy | 1 + hidden_functional_c/sy/11_BST.sy | 1 + hidden_functional_c/sy/12_DSU.sy | 1 + hidden_functional_c/sy/13_LCA.sy | 1 + hidden_functional_c/sy/14_dp.sy | 1 + hidden_functional_c/sy/15_graph_coloring.sy | 1 + hidden_functional_c/sy/16_k_smallest.sy | 1 + hidden_functional_c/sy/17_maximal_clique.sy | 1 + hidden_functional_c/sy/18_prim.sy | 1 + hidden_functional_c/sy/19_search.sy | 1 + hidden_functional_c/sy/20_sort.sy | 1 + hidden_functional_c/sy/21_union_find.sy | 1 + hidden_functional_c/sy/22_matrix_multiply.sy | 1 + hidden_functional_c/sy/23_json.sy | 1 + hidden_functional_c/sy/24_array_only.sy | 1 + hidden_functional_c/sy/25_scope3.sy | 1 + hidden_functional_c/sy/26_scope4.sy | 1 + hidden_functional_c/sy/27_scope5.sy | 1 + hidden_functional_c/sy/28_side_effect2.sy | 1 + hidden_functional_c/sy/29_long_line.sy | 1 + hidden_functional_c/sy/30_many_dimensions.sy | 1 + hidden_functional_c/sy/31_many_indirections.sy | 1 + hidden_functional_c/sy/32_many_params3.sy | 1 + hidden_functional_c/sy/33_multi_branch.sy | 1 + hidden_functional_c/sy/34_multi_loop.sy | 1 + hidden_functional_c/sy/35_math.sy | 1 + hidden_functional_c/sy/39_fp_params.sy | 1 + performance_c/sy/00_bitset1.sy | 1 + performance_c/sy/00_bitset2.sy | 1 + performance_c/sy/00_bitset3.sy | 1 + performance_c/sy/01_mm1.sy | 1 + performance_c/sy/01_mm2.sy | 1 + performance_c/sy/01_mm3.sy | 1 + performance_c/sy/02_mv1.sy | 1 + performance_c/sy/02_mv2.sy | 1 + performance_c/sy/02_mv3.sy | 1 + performance_c/sy/03_sort1.sy | 1 + performance_c/sy/03_sort2.sy | 1 + performance_c/sy/03_sort3.sy | 1 + performance_c/sy/04_spmv1.sy | 1 + performance_c/sy/04_spmv2.sy | 1 + performance_c/sy/04_spmv3.sy | 1 + performance_c/sy/brainfuck-bootstrap.sy | 1 + performance_c/sy/brainfuck-mandelbrot-nerf.sy | 1 + performance_c/sy/brainfuck-pi-nerf.sy | 1 + performance_c/sy/conv0.sy | 1 + performance_c/sy/conv1.sy | 1 + performance_c/sy/conv2.sy | 1 + performance_c/sy/crypto-1.sy | 1 + performance_c/sy/crypto-2.sy | 1 + performance_c/sy/crypto-3.sy | 1 + performance_c/sy/dead-code-elimination-1.sy | 1 + performance_c/sy/dead-code-elimination-2.sy | 1 + performance_c/sy/dead-code-elimination-3.sy | 1 + performance_c/sy/fft0.sy | 1 + performance_c/sy/fft1.sy | 1 + performance_c/sy/fft2.sy | 1 + performance_c/sy/floyd-0.sy | 1 + performance_c/sy/floyd-1.sy | 1 + performance_c/sy/floyd-2.sy | 1 + performance_c/sy/gameoflife-gosper.sy | 1 + performance_c/sy/gameoflife-oscillator.sy | 1 + performance_c/sy/gameoflife-p61glidergun.sy | 1 + performance_c/sy/hoist-1.sy | 1 + performance_c/sy/hoist-2.sy | 1 + performance_c/sy/hoist-3.sy | 1 + performance_c/sy/instruction-combining-1.sy | 1 + performance_c/sy/instruction-combining-2.sy | 1 + performance_c/sy/instruction-combining-3.sy | 1 + performance_c/sy/integer-divide-optimization-1.sy | 1 + performance_c/sy/integer-divide-optimization-2.sy | 1 + performance_c/sy/integer-divide-optimization-3.sy | 1 + performance_c/sy/median0.sy | 1 + performance_c/sy/median1.sy | 1 + performance_c/sy/median2.sy | 1 + performance_c/sy/shuffle0.sy | 1 + performance_c/sy/shuffle1.sy | 1 + performance_c/sy/shuffle2.sy | 1 + performance_c/sy/sl1.sy | 1 + performance_c/sy/sl2.sy | 1 + performance_c/sy/sl3.sy | 1 + performance_c/sy/stencil0.sy | 1 + performance_c/sy/stencil1.sy | 1 + performance_c/sy/transpose0.sy | 1 + performance_c/sy/transpose1.sy | 1 + performance_c/sy/transpose2.sy | 1 + scripts/add_incs.sh | 10 ++++++++++ scripts/inc.sh | 10 ---------- 234 files changed, 242 insertions(+), 10 deletions(-) create mode 100644 scripts/add_incs.sh delete mode 100644 scripts/inc.sh diff --git a/final_performance_c/sy/01_mm1.sy b/final_performance_c/sy/01_mm1.sy index 15e9ad0..81f60c2 100644 --- a/final_performance_c/sy/01_mm1.sy +++ b/final_performance_c/sy/01_mm1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define N 1024 void mm(int n, int A[][N], int B[][N], int C[][N]) diff --git a/final_performance_c/sy/01_mm2.sy b/final_performance_c/sy/01_mm2.sy index 15e9ad0..81f60c2 100644 --- a/final_performance_c/sy/01_mm2.sy +++ b/final_performance_c/sy/01_mm2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define N 1024 void mm(int n, int A[][N], int B[][N], int C[][N]) diff --git a/final_performance_c/sy/01_mm3.sy b/final_performance_c/sy/01_mm3.sy index 15e9ad0..81f60c2 100644 --- a/final_performance_c/sy/01_mm3.sy +++ b/final_performance_c/sy/01_mm3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define N 1024 void mm(int n, int A[][N], int B[][N], int C[][N]) diff --git a/final_performance_c/sy/03_sort1.sy b/final_performance_c/sy/03_sort1.sy index 514b887..4a29deb 100644 --- a/final_performance_c/sy/03_sort1.sy +++ b/final_performance_c/sy/03_sort1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define base 16 int getMaxNum(int n, int arr[]){ diff --git a/final_performance_c/sy/03_sort2.sy b/final_performance_c/sy/03_sort2.sy index 514b887..4a29deb 100644 --- a/final_performance_c/sy/03_sort2.sy +++ b/final_performance_c/sy/03_sort2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define base 16 int getMaxNum(int n, int arr[]){ diff --git a/final_performance_c/sy/03_sort3.sy b/final_performance_c/sy/03_sort3.sy index b4edc94..39e76af 100644 --- a/final_performance_c/sy/03_sort3.sy +++ b/final_performance_c/sy/03_sort3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define base 16 int getMaxNum(int n, int arr[]) diff --git a/final_performance_c/sy/04_spmv1.sy b/final_performance_c/sy/04_spmv1.sy index e5c8d97..0b5423e 100644 --- a/final_performance_c/sy/04_spmv1.sy +++ b/final_performance_c/sy/04_spmv1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ int i, j, k; i = 0; diff --git a/final_performance_c/sy/04_spmv2.sy b/final_performance_c/sy/04_spmv2.sy index e5c8d97..0b5423e 100644 --- a/final_performance_c/sy/04_spmv2.sy +++ b/final_performance_c/sy/04_spmv2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ int i, j, k; i = 0; diff --git a/final_performance_c/sy/04_spmv3.sy b/final_performance_c/sy/04_spmv3.sy index e5c8d97..0b5423e 100644 --- a/final_performance_c/sy/04_spmv3.sy +++ b/final_performance_c/sy/04_spmv3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ int i, j, k; i = 0; diff --git a/final_performance_c/sy/fft0.sy b/final_performance_c/sy/fft0.sy index 04299b8..665610f 100644 --- a/final_performance_c/sy/fft0.sy +++ b/final_performance_c/sy/fft0.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define mod 998244353 int d; diff --git a/final_performance_c/sy/fft1.sy b/final_performance_c/sy/fft1.sy index 04299b8..665610f 100644 --- a/final_performance_c/sy/fft1.sy +++ b/final_performance_c/sy/fft1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define mod 998244353 int d; diff --git a/final_performance_c/sy/fft2.sy b/final_performance_c/sy/fft2.sy index 04299b8..665610f 100644 --- a/final_performance_c/sy/fft2.sy +++ b/final_performance_c/sy/fft2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define mod 998244353 int d; diff --git a/final_performance_c/sy/gameoflife-gosper.sy b/final_performance_c/sy/gameoflife-gosper.sy index 6238833..01b8886 100644 --- a/final_performance_c/sy/gameoflife-gosper.sy +++ b/final_performance_c/sy/gameoflife-gosper.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int sheet1[500][500] = {}; int sheet2[500][500] = {}; int active = 1; diff --git a/final_performance_c/sy/gameoflife-oscillator.sy b/final_performance_c/sy/gameoflife-oscillator.sy index 9a6c96f..a992562 100644 --- a/final_performance_c/sy/gameoflife-oscillator.sy +++ b/final_performance_c/sy/gameoflife-oscillator.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int sheet1[500][500] = {}; int sheet2[500][500] = {}; int active = 1; diff --git a/final_performance_c/sy/gameoflife-p61glidergun.sy b/final_performance_c/sy/gameoflife-p61glidergun.sy index 9a6c96f..a992562 100644 --- a/final_performance_c/sy/gameoflife-p61glidergun.sy +++ b/final_performance_c/sy/gameoflife-p61glidergun.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int sheet1[500][500] = {}; int sheet2[500][500] = {}; int active = 1; diff --git a/final_performance_c/sy/if-combine1.sy b/final_performance_c/sy/if-combine1.sy index f2a5627..9aedb8e 100644 --- a/final_performance_c/sy/if-combine1.sy +++ b/final_performance_c/sy/if-combine1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int func(int n) { int sum = 0; int i = 200; diff --git a/final_performance_c/sy/if-combine2.sy b/final_performance_c/sy/if-combine2.sy index e427764..2d86f95 100644 --- a/final_performance_c/sy/if-combine2.sy +++ b/final_performance_c/sy/if-combine2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int func(int n) { int sum = 0; diff --git a/final_performance_c/sy/if-combine3.sy b/final_performance_c/sy/if-combine3.sy index f2a5627..9aedb8e 100644 --- a/final_performance_c/sy/if-combine3.sy +++ b/final_performance_c/sy/if-combine3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int func(int n) { int sum = 0; int i = 200; diff --git a/final_performance_c/sy/large_loop_array_1.sy b/final_performance_c/sy/large_loop_array_1.sy index 4912e80..02e4d80 100644 --- a/final_performance_c/sy/large_loop_array_1.sy +++ b/final_performance_c/sy/large_loop_array_1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //large loop and large array caculate int COUNT = 500000; diff --git a/final_performance_c/sy/large_loop_array_2.sy b/final_performance_c/sy/large_loop_array_2.sy index 8475b85..c77dff7 100644 --- a/final_performance_c/sy/large_loop_array_2.sy +++ b/final_performance_c/sy/large_loop_array_2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int COUNT = 500000; float loop(float x[], float y[], int length) { diff --git a/final_performance_c/sy/large_loop_array_3.sy b/final_performance_c/sy/large_loop_array_3.sy index 143b8c9..849b71c 100644 --- a/final_performance_c/sy/large_loop_array_3.sy +++ b/final_performance_c/sy/large_loop_array_3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int COUNT = 100000; float loop(float x[], float y[], int length) { diff --git a/final_performance_c/sy/matmul1.sy b/final_performance_c/sy/matmul1.sy index 639814f..c2454af 100644 --- a/final_performance_c/sy/matmul1.sy +++ b/final_performance_c/sy/matmul1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a[1000][1000]; int b[1000][1000]; int c[1000][1000]; diff --git a/final_performance_c/sy/matmul2.sy b/final_performance_c/sy/matmul2.sy index 639814f..c2454af 100644 --- a/final_performance_c/sy/matmul2.sy +++ b/final_performance_c/sy/matmul2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a[1000][1000]; int b[1000][1000]; int c[1000][1000]; diff --git a/final_performance_c/sy/matmul3.sy b/final_performance_c/sy/matmul3.sy index 639814f..c2454af 100644 --- a/final_performance_c/sy/matmul3.sy +++ b/final_performance_c/sy/matmul3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a[1000][1000]; int b[1000][1000]; int c[1000][1000]; diff --git a/final_performance_c/sy/recursive_call_1.sy b/final_performance_c/sy/recursive_call_1.sy index b0922d9..8281281 100644 --- a/final_performance_c/sy/recursive_call_1.sy +++ b/final_performance_c/sy/recursive_call_1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" float myabs(float num) { if (num > 0) { diff --git a/final_performance_c/sy/recursive_call_2.sy b/final_performance_c/sy/recursive_call_2.sy index a9a4da6..d8b919e 100644 --- a/final_performance_c/sy/recursive_call_2.sy +++ b/final_performance_c/sy/recursive_call_2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" float myabs(float num) { if(num>0){ return num; diff --git a/final_performance_c/sy/recursive_call_3.sy b/final_performance_c/sy/recursive_call_3.sy index 31b2156..185404e 100644 --- a/final_performance_c/sy/recursive_call_3.sy +++ b/final_performance_c/sy/recursive_call_3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" float myabs(float num) { if(num>0){ return num; diff --git a/final_performance_c/sy/shuffle0.sy b/final_performance_c/sy/shuffle0.sy index 5a76aad..0974e19 100644 --- a/final_performance_c/sy/shuffle0.sy +++ b/final_performance_c/sy/shuffle0.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int hashmod; #define maxn 10000000 diff --git a/final_performance_c/sy/shuffle1.sy b/final_performance_c/sy/shuffle1.sy index 5a76aad..0974e19 100644 --- a/final_performance_c/sy/shuffle1.sy +++ b/final_performance_c/sy/shuffle1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int hashmod; #define maxn 10000000 diff --git a/final_performance_c/sy/shuffle2.sy b/final_performance_c/sy/shuffle2.sy index 5a76aad..0974e19 100644 --- a/final_performance_c/sy/shuffle2.sy +++ b/final_performance_c/sy/shuffle2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int hashmod; #define maxn 10000000 diff --git a/final_performance_c/sy/sl1.sy b/final_performance_c/sy/sl1.sy index be7c930..f9d9da0 100644 --- a/final_performance_c/sy/sl1.sy +++ b/final_performance_c/sy/sl1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int x[600][600][600]; int y[600][600][600]; diff --git a/final_performance_c/sy/sl2.sy b/final_performance_c/sy/sl2.sy index be7c930..f9d9da0 100644 --- a/final_performance_c/sy/sl2.sy +++ b/final_performance_c/sy/sl2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int x[600][600][600]; int y[600][600][600]; diff --git a/final_performance_c/sy/sl3.sy b/final_performance_c/sy/sl3.sy index be7c930..f9d9da0 100644 --- a/final_performance_c/sy/sl3.sy +++ b/final_performance_c/sy/sl3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int x[600][600][600]; int y[600][600][600]; diff --git a/final_performance_c/sy/transpose0.sy b/final_performance_c/sy/transpose0.sy index 7e4291d..94d4409 100644 --- a/final_performance_c/sy/transpose0.sy +++ b/final_performance_c/sy/transpose0.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int matrix[20000000]; int a[100000]; diff --git a/final_performance_c/sy/transpose1.sy b/final_performance_c/sy/transpose1.sy index 7e4291d..94d4409 100644 --- a/final_performance_c/sy/transpose1.sy +++ b/final_performance_c/sy/transpose1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int matrix[20000000]; int a[100000]; diff --git a/final_performance_c/sy/transpose2.sy b/final_performance_c/sy/transpose2.sy index 7e4291d..94d4409 100644 --- a/final_performance_c/sy/transpose2.sy +++ b/final_performance_c/sy/transpose2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int matrix[20000000]; int a[100000]; diff --git a/functional_c/sy/00_main.sy b/functional_c/sy/00_main.sy index 7236812..dba2970 100644 --- a/functional_c/sy/00_main.sy +++ b/functional_c/sy/00_main.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main(){ return 3; } diff --git a/functional_c/sy/01_var_defn2.sy b/functional_c/sy/01_var_defn2.sy index 5b18fc7..77d51f3 100644 --- a/functional_c/sy/01_var_defn2.sy +++ b/functional_c/sy/01_var_defn2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test domain of global var define and local define int a = 3; int b = 5; diff --git a/functional_c/sy/02_var_defn3.sy b/functional_c/sy/02_var_defn3.sy index 77d864f..2d6a64d 100644 --- a/functional_c/sy/02_var_defn3.sy +++ b/functional_c/sy/02_var_defn3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test local var define int main(){ int a, b0, _c; diff --git a/functional_c/sy/03_arr_defn2.sy b/functional_c/sy/03_arr_defn2.sy index 003ff4a..64b8c6e 100644 --- a/functional_c/sy/03_arr_defn2.sy +++ b/functional_c/sy/03_arr_defn2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a[10][10]; int main(){ return 0; diff --git a/functional_c/sy/04_arr_defn3.sy b/functional_c/sy/04_arr_defn3.sy index 76b69c6..8ae1121 100644 --- a/functional_c/sy/04_arr_defn3.sy +++ b/functional_c/sy/04_arr_defn3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test array define int main(){ int a[4][2] = {}; diff --git a/functional_c/sy/05_arr_defn4.sy b/functional_c/sy/05_arr_defn4.sy index 315c9a9..6e7518b 100644 --- a/functional_c/sy/05_arr_defn4.sy +++ b/functional_c/sy/05_arr_defn4.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main(){ const int a[4][2] = {{1, 2}, {3, 4}, {}, 7}; #define N 3 diff --git a/functional_c/sy/06_const_var_defn2.sy b/functional_c/sy/06_const_var_defn2.sy index 6f7d20a..42d4c27 100644 --- a/functional_c/sy/06_const_var_defn2.sy +++ b/functional_c/sy/06_const_var_defn2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test const gloal var define const int a = 10, b = 5; diff --git a/functional_c/sy/07_const_var_defn3.sy b/functional_c/sy/07_const_var_defn3.sy index af5e610..e284ea3 100644 --- a/functional_c/sy/07_const_var_defn3.sy +++ b/functional_c/sy/07_const_var_defn3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test const local var define int main(){ const int a = 10, b = 5; diff --git a/functional_c/sy/08_const_array_defn.sy b/functional_c/sy/08_const_array_defn.sy index d42a744..8f97731 100644 --- a/functional_c/sy/08_const_array_defn.sy +++ b/functional_c/sy/08_const_array_defn.sy @@ -1,3 +1,4 @@ +#include "sylib.h" const int a[5]={0,1,2,3,4}; int main(){ diff --git a/functional_c/sy/09_func_defn.sy b/functional_c/sy/09_func_defn.sy index 8b5acb2..a753b37 100644 --- a/functional_c/sy/09_func_defn.sy +++ b/functional_c/sy/09_func_defn.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a; int func(int p){ p = p - 1; diff --git a/functional_c/sy/10_var_defn_func.sy b/functional_c/sy/10_var_defn_func.sy index 2d63168..76d00cd 100644 --- a/functional_c/sy/10_var_defn_func.sy +++ b/functional_c/sy/10_var_defn_func.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int defn(){ return 4; } diff --git a/functional_c/sy/11_add2.sy b/functional_c/sy/11_add2.sy index fe94825..7eda9ca 100644 --- a/functional_c/sy/11_add2.sy +++ b/functional_c/sy/11_add2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test add int main(){ int a, b; diff --git a/functional_c/sy/12_addc.sy b/functional_c/sy/12_addc.sy index 51b3ed1..899cac2 100644 --- a/functional_c/sy/12_addc.sy +++ b/functional_c/sy/12_addc.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test addc #define a 10 int main(){ diff --git a/functional_c/sy/13_sub2.sy b/functional_c/sy/13_sub2.sy index c6da26b..58834a5 100644 --- a/functional_c/sy/13_sub2.sy +++ b/functional_c/sy/13_sub2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test sub #define a 10 int main(){ diff --git a/functional_c/sy/14_subc.sy b/functional_c/sy/14_subc.sy index 4dd644e..550e63f 100644 --- a/functional_c/sy/14_subc.sy +++ b/functional_c/sy/14_subc.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test subc int main(){ int a; diff --git a/functional_c/sy/15_mul.sy b/functional_c/sy/15_mul.sy index d79006b..080533d 100644 --- a/functional_c/sy/15_mul.sy +++ b/functional_c/sy/15_mul.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test mul int main(){ int a, b; diff --git a/functional_c/sy/16_mulc.sy b/functional_c/sy/16_mulc.sy index 5a33756..4dff670 100644 --- a/functional_c/sy/16_mulc.sy +++ b/functional_c/sy/16_mulc.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test mulc #define a 5 int main(){ diff --git a/functional_c/sy/17_div.sy b/functional_c/sy/17_div.sy index 2e548cc..3b79dfe 100644 --- a/functional_c/sy/17_div.sy +++ b/functional_c/sy/17_div.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test div int main(){ int a, b; diff --git a/functional_c/sy/18_divc.sy b/functional_c/sy/18_divc.sy index 29aca78..0420033 100644 --- a/functional_c/sy/18_divc.sy +++ b/functional_c/sy/18_divc.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test divc #define a 10 int main(){ diff --git a/functional_c/sy/19_mod.sy b/functional_c/sy/19_mod.sy index 9a814a2..c3fbab2 100644 --- a/functional_c/sy/19_mod.sy +++ b/functional_c/sy/19_mod.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test mod int main(){ int a; diff --git a/functional_c/sy/20_rem.sy b/functional_c/sy/20_rem.sy index 67ed01a..2928de2 100644 --- a/functional_c/sy/20_rem.sy +++ b/functional_c/sy/20_rem.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test rem int main(){ int a; diff --git a/functional_c/sy/21_if_test2.sy b/functional_c/sy/21_if_test2.sy index ba6d397..1c719f2 100644 --- a/functional_c/sy/21_if_test2.sy +++ b/functional_c/sy/21_if_test2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test if-else-if int ifElseIf() { int a; diff --git a/functional_c/sy/22_if_test3.sy b/functional_c/sy/22_if_test3.sy index 7f48df1..795d476 100644 --- a/functional_c/sy/22_if_test3.sy +++ b/functional_c/sy/22_if_test3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test if-if-else int ififElse() { int a; diff --git a/functional_c/sy/23_if_test4.sy b/functional_c/sy/23_if_test4.sy index fb01502..bfb6d65 100644 --- a/functional_c/sy/23_if_test4.sy +++ b/functional_c/sy/23_if_test4.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test if-{if-else} int if_ifElse_() { int a; diff --git a/functional_c/sy/24_if_test5.sy b/functional_c/sy/24_if_test5.sy index 39cf890..4a00188 100644 --- a/functional_c/sy/24_if_test5.sy +++ b/functional_c/sy/24_if_test5.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test if-{if}-else int if_if_Else() { int a; diff --git a/functional_c/sy/25_while_if.sy b/functional_c/sy/25_while_if.sy index b34ec8a..1d88c8f 100644 --- a/functional_c/sy/25_while_if.sy +++ b/functional_c/sy/25_while_if.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int get_one(int a) { return 1; } diff --git a/functional_c/sy/26_while_test1.sy b/functional_c/sy/26_while_test1.sy index d184d5b..be12a7b 100644 --- a/functional_c/sy/26_while_test1.sy +++ b/functional_c/sy/26_while_test1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int doubleWhile() { int i; i = 5; diff --git a/functional_c/sy/27_while_test2.sy b/functional_c/sy/27_while_test2.sy index d1fad82..4b01eec 100644 --- a/functional_c/sy/27_while_test2.sy +++ b/functional_c/sy/27_while_test2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int FourWhile() { int a; a = 5; diff --git a/functional_c/sy/28_while_test3.sy b/functional_c/sy/28_while_test3.sy index 47ffb5f..c78a0cf 100644 --- a/functional_c/sy/28_while_test3.sy +++ b/functional_c/sy/28_while_test3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int g; int h; int f; diff --git a/functional_c/sy/29_break.sy b/functional_c/sy/29_break.sy index 918bf38..066be74 100644 --- a/functional_c/sy/29_break.sy +++ b/functional_c/sy/29_break.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test break int main(){ int i; diff --git a/functional_c/sy/30_continue.sy b/functional_c/sy/30_continue.sy index cde26b2..5efee78 100644 --- a/functional_c/sy/30_continue.sy +++ b/functional_c/sy/30_continue.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test continue int main(){ int i; diff --git a/functional_c/sy/31_while_if_test1.sy b/functional_c/sy/31_while_if_test1.sy index 2d2b9fb..cf2cb7e 100644 --- a/functional_c/sy/31_while_if_test1.sy +++ b/functional_c/sy/31_while_if_test1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test while-if int whileIf() { int a; diff --git a/functional_c/sy/32_while_if_test2.sy b/functional_c/sy/32_while_if_test2.sy index 34c92da..6e1a1af 100644 --- a/functional_c/sy/32_while_if_test2.sy +++ b/functional_c/sy/32_while_if_test2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int ifWhile() { int a; a = 0; diff --git a/functional_c/sy/33_while_if_test3.sy b/functional_c/sy/33_while_if_test3.sy index ef16dfa..e7f3729 100644 --- a/functional_c/sy/33_while_if_test3.sy +++ b/functional_c/sy/33_while_if_test3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int deepWhileBr(int a, int b) { int c; c = a + b; diff --git a/functional_c/sy/34_arr_expr_len.sy b/functional_c/sy/34_arr_expr_len.sy index a42dd56..cb6890b 100644 --- a/functional_c/sy/34_arr_expr_len.sy +++ b/functional_c/sy/34_arr_expr_len.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define N -1 diff --git a/functional_c/sy/35_op_priority1.sy b/functional_c/sy/35_op_priority1.sy index c3b6abc..b099c28 100644 --- a/functional_c/sy/35_op_priority1.sy +++ b/functional_c/sy/35_op_priority1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test the priority of add and mul int main(){ int a, b, c, d; diff --git a/functional_c/sy/36_op_priority2.sy b/functional_c/sy/36_op_priority2.sy index 148ca3b..3cd6a53 100644 --- a/functional_c/sy/36_op_priority2.sy +++ b/functional_c/sy/36_op_priority2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test the priority of add and mul int main(){ int a, b, c, d; diff --git a/functional_c/sy/37_op_priority3.sy b/functional_c/sy/37_op_priority3.sy index 97cc7c2..3ff32d9 100644 --- a/functional_c/sy/37_op_priority3.sy +++ b/functional_c/sy/37_op_priority3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test the priority of unary operator and binary operator int main(){ int a, b; diff --git a/functional_c/sy/38_op_priority4.sy b/functional_c/sy/38_op_priority4.sy index 6246557..dd0f9c2 100644 --- a/functional_c/sy/38_op_priority4.sy +++ b/functional_c/sy/38_op_priority4.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a; int b; int c; diff --git a/functional_c/sy/39_op_priority5.sy b/functional_c/sy/39_op_priority5.sy index 85632fb..4d10473 100644 --- a/functional_c/sy/39_op_priority5.sy +++ b/functional_c/sy/39_op_priority5.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a = 1; int b = 0; int c = 1; diff --git a/functional_c/sy/40_unary_op.sy b/functional_c/sy/40_unary_op.sy index 14ca2c9..fe852bb 100644 --- a/functional_c/sy/40_unary_op.sy +++ b/functional_c/sy/40_unary_op.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a; a = 10; diff --git a/functional_c/sy/41_unary_op2.sy b/functional_c/sy/41_unary_op2.sy index f51079c..ec397bd 100644 --- a/functional_c/sy/41_unary_op2.sy +++ b/functional_c/sy/41_unary_op2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a, b; a = 070; diff --git a/functional_c/sy/42_empty_stmt.sy b/functional_c/sy/42_empty_stmt.sy index a8c161f..34e84ac 100644 --- a/functional_c/sy/42_empty_stmt.sy +++ b/functional_c/sy/42_empty_stmt.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a = 10; ; diff --git a/functional_c/sy/43_logi_assign.sy b/functional_c/sy/43_logi_assign.sy index dd96553..454ea15 100644 --- a/functional_c/sy/43_logi_assign.sy +++ b/functional_c/sy/43_logi_assign.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a; int b; int main() diff --git a/functional_c/sy/44_stmt_expr.sy b/functional_c/sy/44_stmt_expr.sy index b03b86d..2555fd4 100644 --- a/functional_c/sy/44_stmt_expr.sy +++ b/functional_c/sy/44_stmt_expr.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int k; #define n 10 int main () { diff --git a/functional_c/sy/45_comment1.sy b/functional_c/sy/45_comment1.sy index f2d002a..73bbeef 100644 --- a/functional_c/sy/45_comment1.sy +++ b/functional_c/sy/45_comment1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test comment int main(){ int a; diff --git a/functional_c/sy/46_hex_defn.sy b/functional_c/sy/46_hex_defn.sy index 4e85018..cf9134b 100644 --- a/functional_c/sy/46_hex_defn.sy +++ b/functional_c/sy/46_hex_defn.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // test hexadecimal define int main(){ int a; diff --git a/functional_c/sy/47_hex_oct_add.sy b/functional_c/sy/47_hex_oct_add.sy index 6b99bcf..6975b01 100644 --- a/functional_c/sy/47_hex_oct_add.sy +++ b/functional_c/sy/47_hex_oct_add.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //test add of hex and oct int main(){ int a, b; diff --git a/functional_c/sy/48_assign_complex_expr.sy b/functional_c/sy/48_assign_complex_expr.sy index c6471a7..433cc1a 100644 --- a/functional_c/sy/48_assign_complex_expr.sy +++ b/functional_c/sy/48_assign_complex_expr.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // Use complex expression in assign structure int main () { int a; diff --git a/functional_c/sy/49_if_complex_expr.sy b/functional_c/sy/49_if_complex_expr.sy index 32c897c..411b9f6 100644 --- a/functional_c/sy/49_if_complex_expr.sy +++ b/functional_c/sy/49_if_complex_expr.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // Use complex expression in if structure int main () { int a; diff --git a/functional_c/sy/50_short_circuit.sy b/functional_c/sy/50_short_circuit.sy index 322855d..99d1b7e 100644 --- a/functional_c/sy/50_short_circuit.sy +++ b/functional_c/sy/50_short_circuit.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int g = 0; int func(int n) { diff --git a/functional_c/sy/51_short_circuit3.sy b/functional_c/sy/51_short_circuit3.sy index cb54908..6f5dd3c 100644 --- a/functional_c/sy/51_short_circuit3.sy +++ b/functional_c/sy/51_short_circuit3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a, b, d; int set_a(int val) { a = val; return a; } diff --git a/functional_c/sy/52_scope.sy b/functional_c/sy/52_scope.sy index 7be1453..868a1f3 100644 --- a/functional_c/sy/52_scope.sy +++ b/functional_c/sy/52_scope.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a = 7; int func() { diff --git a/functional_c/sy/53_scope2.sy b/functional_c/sy/53_scope2.sy index 4457362..0555f6c 100644 --- a/functional_c/sy/53_scope2.sy +++ b/functional_c/sy/53_scope2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int k; int main() { diff --git a/functional_c/sy/54_hidden_var.sy b/functional_c/sy/54_hidden_var.sy index 734fc53..4bece2a 100644 --- a/functional_c/sy/54_hidden_var.sy +++ b/functional_c/sy/54_hidden_var.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int b = 5; int c[4] = {6, 7, 8, 9}; diff --git a/functional_c/sy/55_sort_test1.sy b/functional_c/sy/55_sort_test1.sy index 8491e90..f1e4508 100644 --- a/functional_c/sy/55_sort_test1.sy +++ b/functional_c/sy/55_sort_test1.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int n; int bubblesort(int arr[]) { diff --git a/functional_c/sy/56_sort_test2.sy b/functional_c/sy/56_sort_test2.sy index 8ec1764..85552f8 100644 --- a/functional_c/sy/56_sort_test2.sy +++ b/functional_c/sy/56_sort_test2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int n; int insertsort(int a[]) { diff --git a/functional_c/sy/57_sort_test3.sy b/functional_c/sy/57_sort_test3.sy index f743e52..7c367e1 100644 --- a/functional_c/sy/57_sort_test3.sy +++ b/functional_c/sy/57_sort_test3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int n; int QuickSort(int arr[], int low, int high) { diff --git a/functional_c/sy/58_sort_test4.sy b/functional_c/sy/58_sort_test4.sy index 9280cd1..e7078d7 100644 --- a/functional_c/sy/58_sort_test4.sy +++ b/functional_c/sy/58_sort_test4.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int n; int select_sort(int A[],int n) { diff --git a/functional_c/sy/59_sort_test5.sy b/functional_c/sy/59_sort_test5.sy index 6c634e5..665d40b 100644 --- a/functional_c/sy/59_sort_test5.sy +++ b/functional_c/sy/59_sort_test5.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int n; int swap (int array[], int i, int j){ int temp; diff --git a/functional_c/sy/60_sort_test6.sy b/functional_c/sy/60_sort_test6.sy index 24093c7..0aa7af2 100644 --- a/functional_c/sy/60_sort_test6.sy +++ b/functional_c/sy/60_sort_test6.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int n; int counting_sort(int ini_arr[], int sorted_arr[], int n) { diff --git a/functional_c/sy/61_sort_test7.sy b/functional_c/sy/61_sort_test7.sy index 50561d3..edc9aef 100644 --- a/functional_c/sy/61_sort_test7.sy +++ b/functional_c/sy/61_sort_test7.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int buf[2][100]; // sort [l, r) diff --git a/functional_c/sy/62_percolation.sy b/functional_c/sy/62_percolation.sy index a4fdae8..ddee836 100644 --- a/functional_c/sy/62_percolation.sy +++ b/functional_c/sy/62_percolation.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int array[110]; int n; void init(int n) { diff --git a/functional_c/sy/63_big_int_mul.sy b/functional_c/sy/63_big_int_mul.sy index da5e204..fef1cfe 100644 --- a/functional_c/sy/63_big_int_mul.sy +++ b/functional_c/sy/63_big_int_mul.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define len 20 int main() diff --git a/functional_c/sy/64_calculator.sy b/functional_c/sy/64_calculator.sy index f67a932..0d91380 100644 --- a/functional_c/sy/64_calculator.sy +++ b/functional_c/sy/64_calculator.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int ints[10000]; int intt; int chas[10000]; diff --git a/functional_c/sy/65_color.sy b/functional_c/sy/65_color.sy index 4e6e8ce..d650868 100644 --- a/functional_c/sy/65_color.sy +++ b/functional_c/sy/65_color.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define maxn 18 #define mod 1000000007 int dp[maxn][maxn][maxn][maxn][maxn][7]; diff --git a/functional_c/sy/66_exgcd.sy b/functional_c/sy/66_exgcd.sy index d8a6109..ae53fbb 100644 --- a/functional_c/sy/66_exgcd.sy +++ b/functional_c/sy/66_exgcd.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int exgcd(int a,int b,int x[],int y[]) { if(b == 0) { x[0] = 1; diff --git a/functional_c/sy/67_reverse_output.sy b/functional_c/sy/67_reverse_output.sy index 1257b4f..f8469fd 100644 --- a/functional_c/sy/67_reverse_output.sy +++ b/functional_c/sy/67_reverse_output.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void reverse(int n) { int next; if (n <= 1) { diff --git a/functional_c/sy/68_brainfk.sy b/functional_c/sy/68_brainfk.sy index b415cb5..419049a 100644 --- a/functional_c/sy/68_brainfk.sy +++ b/functional_c/sy/68_brainfk.sy @@ -1,3 +1,4 @@ +#include "sylib.h" /* a brainfuck interpreter reference: https://gist.github.com/maxcountryman/1699708 diff --git a/functional_c/sy/69_expr_eval.sy b/functional_c/sy/69_expr_eval.sy index 08e95a0..2222b72 100644 --- a/functional_c/sy/69_expr_eval.sy +++ b/functional_c/sy/69_expr_eval.sy @@ -1,3 +1,4 @@ +#include "sylib.h" const int TOKEN_NUM = 0, TOKEN_OTHER = 1; int last_char = 32, num, other; int cur_token; diff --git a/functional_c/sy/70_dijkstra.sy b/functional_c/sy/70_dijkstra.sy index 2c9a07c..b709604 100644 --- a/functional_c/sy/70_dijkstra.sy +++ b/functional_c/sy/70_dijkstra.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define INF 65535 int e[16][16]; int book[16]; diff --git a/functional_c/sy/71_full_conn.sy b/functional_c/sy/71_full_conn.sy index 01f83aa..f95afba 100644 --- a/functional_c/sy/71_full_conn.sy +++ b/functional_c/sy/71_full_conn.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int relu_reg(int a) { diff --git a/functional_c/sy/72_hanoi.sy b/functional_c/sy/72_hanoi.sy index 063bef8..9e2ec57 100644 --- a/functional_c/sy/72_hanoi.sy +++ b/functional_c/sy/72_hanoi.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void move(int x, int y) { diff --git a/functional_c/sy/73_int_io.sy b/functional_c/sy/73_int_io.sy index fdcac45..0816966 100644 --- a/functional_c/sy/73_int_io.sy +++ b/functional_c/sy/73_int_io.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define ascii_0 48 int my_getint() diff --git a/functional_c/sy/74_kmp.sy b/functional_c/sy/74_kmp.sy index ba1e576..242d4db 100644 --- a/functional_c/sy/74_kmp.sy +++ b/functional_c/sy/74_kmp.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void get_next(int str[], int next[]) { diff --git a/functional_c/sy/75_max_flow.sy b/functional_c/sy/75_max_flow.sy index 926f786..45dcecd 100644 --- a/functional_c/sy/75_max_flow.sy +++ b/functional_c/sy/75_max_flow.sy @@ -1,3 +1,4 @@ +#include "sylib.h" /* * Max flow EK with DFS. */ diff --git a/functional_c/sy/76_n_queens.sy b/functional_c/sy/76_n_queens.sy index 5a5c086..ee115e1 100644 --- a/functional_c/sy/76_n_queens.sy +++ b/functional_c/sy/76_n_queens.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int ans[50], sum = 0, n; int row[50], line1[50], line2[100]; diff --git a/functional_c/sy/77_substr.sy b/functional_c/sy/77_substr.sy index 95ce88f..9894629 100644 --- a/functional_c/sy/77_substr.sy +++ b/functional_c/sy/77_substr.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int MAX(int a, int b) { diff --git a/functional_c/sy/78_side_effect.sy b/functional_c/sy/78_side_effect.sy index 064b67e..c21a7e1 100644 --- a/functional_c/sy/78_side_effect.sy +++ b/functional_c/sy/78_side_effect.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a = -1, b = 1; diff --git a/functional_c/sy/79_var_name.sy b/functional_c/sy/79_var_name.sy index 7958f5d..0e89dac 100644 --- a/functional_c/sy/79_var_name.sy +++ b/functional_c/sy/79_var_name.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int xU4UVdo6fPho5bRhUTjrlIMjqIY_evCyLJf0suh6fNNJ_3DxUYEO_xR1xkH9B68yOd4nSYbkstCnMA1BvxzZHFcKgYsWCq9M6sWFj2hbYtXZAMA2V8pUya5kbMgjwVwR_IKh_EeyZ5EU504YyCm79GrBpe7NMhLcqK5b41z3SzpL6eQTdwdgiZLmh_BbdR_2e0ZcLGxpg0kD_SiCYiQWzh5ekfalc_qYy9ohDjYcW4XpZtkKT0LaIwpKT_eexlt3zRaWJlQTLKmDCqe83zBQAyZx9y79siWba8uMlkcoHe7YzKgeb2Lb44q6WW_vA7Kr9_c_I0LjpZWr2nyAcoFo9aOgYD4DikZLLO3GOQnLPymmJWZGewbfJOKcABxkHBbsjYup399BZw8fM62exxL6Os5P6r8dQxQnUAghxk5yVAElumTAW3cKIKf603d1W9zymy8I006tqdZnh2sUZjqZhYn1ljJCZyFbV6Lnp6IUAuM8pm1v2BE_iBujx7lhYKEvlNGPXjkoQjQXhMudJymkqc7H3mC_695Be7Dzlc_jnHycVoDXb4EczmxL2_UqouAWiUjUCG2hWi3t4QaOucBuNtIPw0nquTOLf5rLgbzuVbRfeTzymEnU08sFsRsach7SVQKOenEZ1N6kTBQFE5SZtqb7KGPp9Who2UvLK2fOKx8CQKNv6_Lc5NXh2p8n4Ob8lqo28dyadcRKyElXXvbl0JVfL9hDNy8S1yrJ5dg3wkEW2Xay5l0rE52vwJAbFxnfJXbAUkEBxeNifGgRB872UPpJ040uyvQAuhHXnakBM_3GjgFBcjAZzr_UJ1c3PglWVrFsLB4fID5bt2SQfC9zL2igpbtoxLeNf8QeUO_faaxtzVXWw015a1xytmdBXlfHIz3zBiOepkTKe8JD2S3xI3aBva2SE6J3Cx7QZgg5lLQ9Va9EONhhN4PLzvmj9uEQsxph6Bb0dhR8l65gFMTQM0zY8Ep1kj15kHfwTtjgp_qYcjjMguuFQxOP_Wuhw8tyRfYFDCaXhacEEXwA3Gp7JaXyLpmlZehZXTaO4w6xKYDyrpkycIiZBvyS6fxEqqzEybbmloWe5atTihpsXm9d6j0iyUP56maXEvx7OaOERJRjyTdx0Q2gdU92GE5Y1vyuc1GNj7gTmL84xjHcNQOiC8Blhf3J77ykaAhFYeWAp0W1TtVz = 2; #define Cy92k8jOyGwpymrp_aZeu_vYwQPeRGHYo0nKXgxMsU3ALykomjoy0v7PrBR5MLWuTcPITZzLajYN3kAhROsMQ6uUe3NqQ6QJyFKvM2G1h6mT3QX9DYbJQsDjb_qKv7vEp6fZLUYJbP4BQnFuisvKlzY8Ym0f_IYchIbJQCvl5R0X3cujCWAWQmNXr8sWoyCtt8ghUridaVa8TcycXdrhLOXI4akvL4wY1B3BCAX4nTZsUGemmDbrjvz_XQ37Hw5lRNDM3AuNOb_oeTlLhRcIjoby7T1ozDgHQbUJFDKlD7D999ynqfEwOeJ1UTkX0elvwrn_Cem72IEwj0Kx_bCapCVe5JSCtVSKmoHhm0wlescYbATn21EnuIjiP_bVvzEvjKY9d7azInHGIwWjZJW_I8EgXj0rP9adIEZxSMJ6BLnuegBp71xWiZCJh_s4efmZUatbxHChtdHkY_VnLFku8X29hgVTjgPdTqjbP2Jcu2bV58lnZIt5wQk3rqeTInqkxNW4OvSbvo6np8PVtL0zjbJ5Sx2oSU1KcQTAG4Dgx14Eb8zGbDvs19ErvuUl48YOguAP2tJhbWBZ5Zv7FSg5V6BsF0ABLFmcT1LFgbgI0af8OK8eOrCzbQgG9SLnx9UTJx3_fCGpFOe5TtAqRvc4tqQglgYgfbGUpRT8X3yGln8jnUt6uR2Xgacd0JfjQg8CWLBihfD9JlE2hPUyoNzhaLmiZleiA4dg1I1q_5ugfO5PyfWwEVVwyTAlpaza1fOCAUCJW5Fy7g_fHFBfDNdUf98CJRmULkQ_qKCBxqVTV1JYDHm1vkKFt9qzr9sGxZWyLhQwTaBt2X_diibJJRHPEHGqcyla_O5MOy5VOu5tvpkw3V9Nn0UwUBzWEa32i2ekbzyGHjwsjoCm9q1IRDsunPKOgXpLmo21aUPPjpKH0nwKJWSfOTpa03CYMBjAZAxxLXNyH2wuTPt0ievT3BLmixYFifby5cqUHHZx7oaK6PnfHMoTh8PIF7KUQY2lkO3zgr9TnRNKtra_BbFArmWlWpvBVBBGuXnKuhJXSWRdARZi00QIMeApsc9hPXeV0OT9UiauD3mgxKTvWieLmXXg0ccoUyTkghCWRbA_SVbTEwHvmX8M_987cngFjVGdz7jYuWcTprOvoYc5qzNK8HZnP0iKHka2ysn6qvr4sheXnyybWMTdrMH6ej26BhzU2bHDgLZISeWIdu_mIQIKmgPNY7A6LujG1lp2K86YJ57RGFyTy5lPyV3yTRc3b5MEFMExLrqSx3m_vSNy1jr73sw6qU4wsBDTdhLvfqtR3FfKhcIdYNhz6BzzF50J42BSKYvk5x4oMhs7OSzPwPdMtEDt1BEkciRTt5LZgGBWYTsWAdXV3gbLKz0y2mOked_wgPwcu7dIuid2p1a0pq5SyV0aSYs13abh_ddAoNTiB7ZTwL3mw05WISorBytfJexyq0534kbAnp5DQwnGiAuM5GMVdE0mAnMr 20 diff --git a/functional_c/sy/80_chaos_token.sy b/functional_c/sy/80_chaos_token.sy index 19d6e75..0ab5061 100644 --- a/functional_c/sy/80_chaos_token.sy +++ b/functional_c/sy/80_chaos_token.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int __HELLO [ diff --git a/functional_c/sy/81_skip_spaces.sy b/functional_c/sy/81_skip_spaces.sy index 8d3a07a..6e9b42f 100644 --- a/functional_c/sy/81_skip_spaces.sy +++ b/functional_c/sy/81_skip_spaces.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // ??? // ???? // ????? /* diff --git a/functional_c/sy/82_long_func.sy b/functional_c/sy/82_long_func.sy index 15cc41d..20417c7 100644 --- a/functional_c/sy/82_long_func.sy +++ b/functional_c/sy/82_long_func.sy @@ -1,3 +1,4 @@ +#include "sylib.h" const int SHIFT_TABLE[16] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768}; diff --git a/functional_c/sy/83_long_array.sy b/functional_c/sy/83_long_array.sy index f1438d6..3812cf7 100644 --- a/functional_c/sy/83_long_array.sy +++ b/functional_c/sy/83_long_array.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define N 10000 int long_array(int k) { diff --git a/functional_c/sy/84_long_array2.sy b/functional_c/sy/84_long_array2.sy index 1dcd4a7..df3281c 100644 --- a/functional_c/sy/84_long_array2.sy +++ b/functional_c/sy/84_long_array2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a[4096]; int f1(int b[]) diff --git a/functional_c/sy/85_long_code.sy b/functional_c/sy/85_long_code.sy index 9eb211e..5e3d948 100644 --- a/functional_c/sy/85_long_code.sy +++ b/functional_c/sy/85_long_code.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // Really long code; int n; diff --git a/functional_c/sy/86_long_code2.sy b/functional_c/sy/86_long_code2.sy index a7ea4a6..4aa24ee 100644 --- a/functional_c/sy/86_long_code2.sy +++ b/functional_c/sy/86_long_code2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a[5][20000]; int main() { a[4][19999] = 1; diff --git a/functional_c/sy/87_many_params.sy b/functional_c/sy/87_many_params.sy index 3285342..10255cc 100644 --- a/functional_c/sy/87_many_params.sy +++ b/functional_c/sy/87_many_params.sy @@ -1,3 +1,4 @@ +#include "sylib.h" void sort(int arr[], int len) { int i = 0; while (i < len - 1) { diff --git a/functional_c/sy/88_many_params2.sy b/functional_c/sy/88_many_params2.sy index c108de4..989435c 100644 --- a/functional_c/sy/88_many_params2.sy +++ b/functional_c/sy/88_many_params2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int func(int a, int b[][59], int c, int d[], int e, int f, int g[], int h, int i) { diff --git a/functional_c/sy/89_many_globals.sy b/functional_c/sy/89_many_globals.sy index 247e2fc..d9a9909 100644 --- a/functional_c/sy/89_many_globals.sy +++ b/functional_c/sy/89_many_globals.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // Call a func with many params. int a0; diff --git a/functional_c/sy/90_many_locals.sy b/functional_c/sy/90_many_locals.sy index fd0b4c7..210e5ad 100644 --- a/functional_c/sy/90_many_locals.sy +++ b/functional_c/sy/90_many_locals.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int foo() { diff --git a/functional_c/sy/91_many_locals2.sy b/functional_c/sy/91_many_locals2.sy index 34a37d1..2ef2fd1 100644 --- a/functional_c/sy/91_many_locals2.sy +++ b/functional_c/sy/91_many_locals2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" //sample:input n number, sort them and print them; int n; int main() diff --git a/functional_c/sy/92_register_alloc.sy b/functional_c/sy/92_register_alloc.sy index 9531266..79247a8 100644 --- a/functional_c/sy/92_register_alloc.sy +++ b/functional_c/sy/92_register_alloc.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a1 = 1; int a2 = 2; int a3 = 3; diff --git a/functional_c/sy/93_nested_calls.sy b/functional_c/sy/93_nested_calls.sy index 2d24b77..aa3096b 100644 --- a/functional_c/sy/93_nested_calls.sy +++ b/functional_c/sy/93_nested_calls.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int func1(int x, int y, int z) { if (z == 0) { return x * y; diff --git a/functional_c/sy/94_nested_loops.sy b/functional_c/sy/94_nested_loops.sy index f4b5e30..8df0ff2 100644 --- a/functional_c/sy/94_nested_loops.sy +++ b/functional_c/sy/94_nested_loops.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int arr1[10][2][3][4][5][6][2]; int arr2[10][2][3][2][4][8][7]; diff --git a/functional_c/sy/95_float.sy b/functional_c/sy/95_float.sy index 3372dde..96ad7cf 100644 --- a/functional_c/sy/95_float.sy +++ b/functional_c/sy/95_float.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // float global constants const float RADIUS = 5.5, PI = 03.141592653589793, EPS = 1e-6; diff --git a/functional_c/sy/96_matrix_add.sy b/functional_c/sy/96_matrix_add.sy index b65928b..de2ce9b 100644 --- a/functional_c/sy/96_matrix_add.sy +++ b/functional_c/sy/96_matrix_add.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int M; int L; int N; diff --git a/functional_c/sy/97_matrix_sub.sy b/functional_c/sy/97_matrix_sub.sy index 68cdd66..d9e3fb1 100644 --- a/functional_c/sy/97_matrix_sub.sy +++ b/functional_c/sy/97_matrix_sub.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int N; int M; int L; diff --git a/functional_c/sy/98_matrix_mul.sy b/functional_c/sy/98_matrix_mul.sy index bbea9fc..4f42bf5 100644 --- a/functional_c/sy/98_matrix_mul.sy +++ b/functional_c/sy/98_matrix_mul.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int M; int L; int N; diff --git a/functional_c/sy/99_matrix_tran.sy b/functional_c/sy/99_matrix_tran.sy index 7d05925..2799f3a 100644 --- a/functional_c/sy/99_matrix_tran.sy +++ b/functional_c/sy/99_matrix_tran.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int M; int L; int N; diff --git a/hidden_functional_c/sy/00_comment2.sy b/hidden_functional_c/sy/00_comment2.sy index c0c7ca7..06c5da9 100644 --- a/hidden_functional_c/sy/00_comment2.sy +++ b/hidden_functional_c/sy/00_comment2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" /*/skipher/*/ //int main(){ int main(){ diff --git a/hidden_functional_c/sy/01_multiple_returns.sy b/hidden_functional_c/sy/01_multiple_returns.sy index 18b12f1..19e635b 100644 --- a/hidden_functional_c/sy/01_multiple_returns.sy +++ b/hidden_functional_c/sy/01_multiple_returns.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a, b = 8, c = 12; a = b + c; diff --git a/hidden_functional_c/sy/02_ret_in_block.sy b/hidden_functional_c/sy/02_ret_in_block.sy index 177ac40..689eb15 100644 --- a/hidden_functional_c/sy/02_ret_in_block.sy +++ b/hidden_functional_c/sy/02_ret_in_block.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main(){ int a = 893; int b = 716; diff --git a/hidden_functional_c/sy/03_branch.sy b/hidden_functional_c/sy/03_branch.sy index d191522..8785055 100644 --- a/hidden_functional_c/sy/03_branch.sy +++ b/hidden_functional_c/sy/03_branch.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { #define a 1 #define b 2 diff --git a/hidden_functional_c/sy/04_break_continue.sy b/hidden_functional_c/sy/04_break_continue.sy index abfb8bb..2ee3a16 100644 --- a/hidden_functional_c/sy/04_break_continue.sy +++ b/hidden_functional_c/sy/04_break_continue.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int sum = 0; int i = 0; diff --git a/hidden_functional_c/sy/05_param_name.sy b/hidden_functional_c/sy/05_param_name.sy index a5fd61f..f4da28e 100644 --- a/hidden_functional_c/sy/05_param_name.sy +++ b/hidden_functional_c/sy/05_param_name.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int f(int f) { return f * 2; } diff --git a/hidden_functional_c/sy/06_func_name.sy b/hidden_functional_c/sy/06_func_name.sy index d361896..ebed93b 100644 --- a/hidden_functional_c/sy/06_func_name.sy +++ b/hidden_functional_c/sy/06_func_name.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int f() { return 10; } diff --git a/hidden_functional_c/sy/07_arr_init_nd.sy b/hidden_functional_c/sy/07_arr_init_nd.sy index fbaebf8..bd5e5db 100644 --- a/hidden_functional_c/sy/07_arr_init_nd.sy +++ b/hidden_functional_c/sy/07_arr_init_nd.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a[5][3]; int b[5][3] = {}; diff --git a/hidden_functional_c/sy/08_global_arr_init.sy b/hidden_functional_c/sy/08_global_arr_init.sy index 66a37a2..63db627 100644 --- a/hidden_functional_c/sy/08_global_arr_init.sy +++ b/hidden_functional_c/sy/08_global_arr_init.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a0[3] = {}; int b0[4] = {0, 1}; int c0[7] = {2, 8, 6, 3, 9, 1, 5}; diff --git a/hidden_functional_c/sy/09_BFS.sy b/hidden_functional_c/sy/09_BFS.sy index f280aa8..ddc2049 100644 --- a/hidden_functional_c/sy/09_BFS.sy +++ b/hidden_functional_c/sy/09_BFS.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int quick_read(){ int ch = getch(); int x = 0, f = 0; while (ch < 48 || ch > 57){ diff --git a/hidden_functional_c/sy/10_DFS.sy b/hidden_functional_c/sy/10_DFS.sy index afd8eec..80c63e1 100644 --- a/hidden_functional_c/sy/10_DFS.sy +++ b/hidden_functional_c/sy/10_DFS.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int quick_read(){ int ch = getch(); int x = 0, f = 0; while (ch < 48 || ch > 57){ diff --git a/hidden_functional_c/sy/11_BST.sy b/hidden_functional_c/sy/11_BST.sy index 1aa0fd5..d0d59d4 100644 --- a/hidden_functional_c/sy/11_BST.sy +++ b/hidden_functional_c/sy/11_BST.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define space 32 #define LF 10 #define maxNode 10000 diff --git a/hidden_functional_c/sy/12_DSU.sy b/hidden_functional_c/sy/12_DSU.sy index b459823..e3424a6 100644 --- a/hidden_functional_c/sy/12_DSU.sy +++ b/hidden_functional_c/sy/12_DSU.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int quick_read(){ int ch = getch(); int x = 0, f = 0; while (ch < 48 || ch > 57){ diff --git a/hidden_functional_c/sy/13_LCA.sy b/hidden_functional_c/sy/13_LCA.sy index 520fbf8..172a203 100644 --- a/hidden_functional_c/sy/13_LCA.sy +++ b/hidden_functional_c/sy/13_LCA.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int quick_read(){ int ch = getch(); int x = 0, f = 0; while (ch < 48 || ch > 57){ diff --git a/hidden_functional_c/sy/14_dp.sy b/hidden_functional_c/sy/14_dp.sy index e138104..e7a176c 100644 --- a/hidden_functional_c/sy/14_dp.sy +++ b/hidden_functional_c/sy/14_dp.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int t[1005][2] = { 0 }, dp[1005][35] = { 0 }; int main() { diff --git a/hidden_functional_c/sy/15_graph_coloring.sy b/hidden_functional_c/sy/15_graph_coloring.sy index b3ff1c1..0a4a789 100644 --- a/hidden_functional_c/sy/15_graph_coloring.sy +++ b/hidden_functional_c/sy/15_graph_coloring.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define V 4 #define space 32 #define LF 10 diff --git a/hidden_functional_c/sy/16_k_smallest.sy b/hidden_functional_c/sy/16_k_smallest.sy index 724ffca..ddfba26 100644 --- a/hidden_functional_c/sy/16_k_smallest.sy +++ b/hidden_functional_c/sy/16_k_smallest.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define maxN 1000 #define space 32 int array[maxN]; diff --git a/hidden_functional_c/sy/17_maximal_clique.sy b/hidden_functional_c/sy/17_maximal_clique.sy index 9077d8c..a96b81e 100644 --- a/hidden_functional_c/sy/17_maximal_clique.sy +++ b/hidden_functional_c/sy/17_maximal_clique.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define maxN 30 #define maxM 600 diff --git a/hidden_functional_c/sy/18_prim.sy b/hidden_functional_c/sy/18_prim.sy index 620f2a8..bce7cb1 100644 --- a/hidden_functional_c/sy/18_prim.sy +++ b/hidden_functional_c/sy/18_prim.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int quick_read(){ int ch = getch(); int x = 0, f = 0; while (ch < 48 || ch > 57){ diff --git a/hidden_functional_c/sy/19_search.sy b/hidden_functional_c/sy/19_search.sy index bf2d12e..064a1d2 100644 --- a/hidden_functional_c/sy/19_search.sy +++ b/hidden_functional_c/sy/19_search.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define INF 1073741824 int a[30][30]; int step[4][2] = { {1,0},{-1,0},{0,1},{0,-1} }; diff --git a/hidden_functional_c/sy/20_sort.sy b/hidden_functional_c/sy/20_sort.sy index 5e8c551..446be8e 100644 --- a/hidden_functional_c/sy/20_sort.sy +++ b/hidden_functional_c/sy/20_sort.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int quick_read(){ int ch = getch(); int x = 0, f = 0; while (ch < 48 || ch > 57){ diff --git a/hidden_functional_c/sy/21_union_find.sy b/hidden_functional_c/sy/21_union_find.sy index 3138a21..f498fc4 100644 --- a/hidden_functional_c/sy/21_union_find.sy +++ b/hidden_functional_c/sy/21_union_find.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define maxN 1005 int parent[maxN]; diff --git a/hidden_functional_c/sy/22_matrix_multiply.sy b/hidden_functional_c/sy/22_matrix_multiply.sy index 699e78d..da14290 100644 --- a/hidden_functional_c/sy/22_matrix_multiply.sy +++ b/hidden_functional_c/sy/22_matrix_multiply.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define MAX_SIZE 100 int a[MAX_SIZE][MAX_SIZE], b[MAX_SIZE][MAX_SIZE]; int res[MAX_SIZE][MAX_SIZE]; diff --git a/hidden_functional_c/sy/23_json.sy b/hidden_functional_c/sy/23_json.sy index 381df18..6822c1c 100644 --- a/hidden_functional_c/sy/23_json.sy +++ b/hidden_functional_c/sy/23_json.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // ** JSON parser ** // returns 0 if structure is correct, 1 if incorrect diff --git a/hidden_functional_c/sy/24_array_only.sy b/hidden_functional_c/sy/24_array_only.sy index 1a9c908..466d75e 100644 --- a/hidden_functional_c/sy/24_array_only.sy +++ b/hidden_functional_c/sy/24_array_only.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int i[1], k[1]; void inc_impl(int x[], int rec) { diff --git a/hidden_functional_c/sy/25_scope3.sy b/hidden_functional_c/sy/25_scope3.sy index 3dfc474..87b1b25 100644 --- a/hidden_functional_c/sy/25_scope3.sy +++ b/hidden_functional_c/sy/25_scope3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { /* scope test */ putch(97); diff --git a/hidden_functional_c/sy/26_scope4.sy b/hidden_functional_c/sy/26_scope4.sy index 687d13d..74ee7fe 100644 --- a/hidden_functional_c/sy/26_scope4.sy +++ b/hidden_functional_c/sy/26_scope4.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int a; int sum; int count = 0; diff --git a/hidden_functional_c/sy/27_scope5.sy b/hidden_functional_c/sy/27_scope5.sy index 2887321..28c07eb 100644 --- a/hidden_functional_c/sy/27_scope5.sy +++ b/hidden_functional_c/sy/27_scope5.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main(){ int a = 0, sum = 0; a = a + -2; diff --git a/hidden_functional_c/sy/28_side_effect2.sy b/hidden_functional_c/sy/28_side_effect2.sy index ca2e4d9..4a47817 100644 --- a/hidden_functional_c/sy/28_side_effect2.sy +++ b/hidden_functional_c/sy/28_side_effect2.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int sum = 0; int array[20]; diff --git a/hidden_functional_c/sy/29_long_line.sy b/hidden_functional_c/sy/29_long_line.sy index 83be600..fe7ee6b 100644 --- a/hidden_functional_c/sy/29_long_line.sy +++ b/hidden_functional_c/sy/29_long_line.sy @@ -1 +1,2 @@ +#include "sylib.h" int fib(int n) { if (n <= 2) return 1; int n1; { int neg_b; { int not_a; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (1); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15; { if (!(a0)) { o0 = 1; } else { o0 = 0; } }; { if (!(a1)) { o1 = 1; } else { o1 = 0; } }; { if (!(a2)) { o2 = 1; } else { o2 = 0; } }; { if (!(a3)) { o3 = 1; } else { o3 = 0; } }; { if (!(a4)) { o4 = 1; } else { o4 = 0; } }; { if (!(a5)) { o5 = 1; } else { o5 = 0; } }; { if (!(a6)) { o6 = 1; } else { o6 = 0; } }; { if (!(a7)) { o7 = 1; } else { o7 = 0; } }; { if (!(a8)) { o8 = 1; } else { o8 = 0; } }; { if (!(a9)) { o9 = 1; } else { o9 = 0; } }; { if (!(a10)) { o10 = 1; } else { o10 = 0; } }; { if (!(a11)) { o11 = 1; } else { o11 = 0; } }; { if (!(a12)) { o12 = 1; } else { o12 = 0; } }; { if (!(a13)) { o13 = 1; } else { o13 = 0; } }; { if (!(a14)) { o14 = 1; } else { o14 = 0; } }; { if (!(a15)) { o15 = 1; } else { o15 = 0; } }; { not_a = 0; not_a = not_a * 2 + (o15); not_a = not_a * 2 + (o14); not_a = not_a * 2 + (o13); not_a = not_a * 2 + (o12); not_a = not_a * 2 + (o11); not_a = not_a * 2 + (o10); not_a = not_a * 2 + (o9); not_a = not_a * 2 + (o8); not_a = not_a * 2 + (o7); not_a = not_a * 2 + (o6); not_a = not_a * 2 + (o5); not_a = not_a * 2 + (o4); not_a = not_a * 2 + (o3); not_a = not_a * 2 + (o2); not_a = not_a * 2 + (o1); not_a = not_a * 2 + (o0); }; }; { int cout; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (not_a); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; { int temp = (1); { b0 = temp % 2; if (b0 < 0) b0 = -b0; temp = temp / 2; }; { b1 = temp % 2; if (b1 < 0) b1 = -b1; temp = temp / 2; }; { b2 = temp % 2; if (b2 < 0) b2 = -b2; temp = temp / 2; }; { b3 = temp % 2; if (b3 < 0) b3 = -b3; temp = temp / 2; }; { b4 = temp % 2; if (b4 < 0) b4 = -b4; temp = temp / 2; }; { b5 = temp % 2; if (b5 < 0) b5 = -b5; temp = temp / 2; }; { b6 = temp % 2; if (b6 < 0) b6 = -b6; temp = temp / 2; }; { b7 = temp % 2; if (b7 < 0) b7 = -b7; temp = temp / 2; }; { b8 = temp % 2; if (b8 < 0) b8 = -b8; temp = temp / 2; }; { b9 = temp % 2; if (b9 < 0) b9 = -b9; temp = temp / 2; }; { b10 = temp % 2; if (b10 < 0) b10 = -b10; temp = temp / 2; }; { b11 = temp % 2; if (b11 < 0) b11 = -b11; temp = temp / 2; }; { b12 = temp % 2; if (b12 < 0) b12 = -b12; temp = temp / 2; }; { b13 = temp % 2; if (b13 < 0) b13 = -b13; temp = temp / 2; }; { b14 = temp % 2; if (b14 < 0) b14 = -b14; temp = temp / 2; }; { b15 = temp % 2; if (b15 < 0) b15 = -b15; temp = temp / 2; }; }; int c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; { int a_xor_b; { int a_or_b; { if ((a0) || (b0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s0 = 1; } else { s0 = 0; } }; }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c0 = 1; } else { c0 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a1) || (b1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s1 = 1; } else { s1 = 0; } }; }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c1 = 1; } else { c1 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a2) || (b2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s2 = 1; } else { s2 = 0; } }; }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c1)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c2 = 1; } else { c2 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a3) || (b3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s3 = 1; } else { s3 = 0; } }; }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c2)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c3 = 1; } else { c3 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a4) || (b4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s4 = 1; } else { s4 = 0; } }; }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c3)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c4 = 1; } else { c4 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a5) || (b5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s5 = 1; } else { s5 = 0; } }; }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c4)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c5 = 1; } else { c5 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a6) || (b6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s6 = 1; } else { s6 = 0; } }; }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c5)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c6 = 1; } else { c6 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a7) || (b7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s7 = 1; } else { s7 = 0; } }; }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c6)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c7 = 1; } else { c7 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a8) || (b8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s8 = 1; } else { s8 = 0; } }; }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c7)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c8 = 1; } else { c8 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a9) || (b9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s9 = 1; } else { s9 = 0; } }; }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c8)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c9 = 1; } else { c9 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a10) || (b10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s10 = 1; } else { s10 = 0; } }; }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c9)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c10 = 1; } else { c10 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a11) || (b11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s11 = 1; } else { s11 = 0; } }; }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c10)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c11 = 1; } else { c11 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a12) || (b12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s12 = 1; } else { s12 = 0; } }; }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c11)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c12 = 1; } else { c12 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a13) || (b13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s13 = 1; } else { s13 = 0; } }; }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c12)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c13 = 1; } else { c13 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a14) || (b14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s14 = 1; } else { s14 = 0; } }; }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c13)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c14 = 1; } else { c14 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a15) || (b15)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s15 = 1; } else { s15 = 0; } }; }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c14)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { cout = 1; } else { cout = 0; } }; }; { neg_b = 0; neg_b = neg_b * 2 + (s15); neg_b = neg_b * 2 + (s14); neg_b = neg_b * 2 + (s13); neg_b = neg_b * 2 + (s12); neg_b = neg_b * 2 + (s11); neg_b = neg_b * 2 + (s10); neg_b = neg_b * 2 + (s9); neg_b = neg_b * 2 + (s8); neg_b = neg_b * 2 + (s7); neg_b = neg_b * 2 + (s6); neg_b = neg_b * 2 + (s5); neg_b = neg_b * 2 + (s4); neg_b = neg_b * 2 + (s3); neg_b = neg_b * 2 + (s2); neg_b = neg_b * 2 + (s1); neg_b = neg_b * 2 + (s0); }; }; }; }; { int cout; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (n); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; { int temp = (neg_b); { b0 = temp % 2; if (b0 < 0) b0 = -b0; temp = temp / 2; }; { b1 = temp % 2; if (b1 < 0) b1 = -b1; temp = temp / 2; }; { b2 = temp % 2; if (b2 < 0) b2 = -b2; temp = temp / 2; }; { b3 = temp % 2; if (b3 < 0) b3 = -b3; temp = temp / 2; }; { b4 = temp % 2; if (b4 < 0) b4 = -b4; temp = temp / 2; }; { b5 = temp % 2; if (b5 < 0) b5 = -b5; temp = temp / 2; }; { b6 = temp % 2; if (b6 < 0) b6 = -b6; temp = temp / 2; }; { b7 = temp % 2; if (b7 < 0) b7 = -b7; temp = temp / 2; }; { b8 = temp % 2; if (b8 < 0) b8 = -b8; temp = temp / 2; }; { b9 = temp % 2; if (b9 < 0) b9 = -b9; temp = temp / 2; }; { b10 = temp % 2; if (b10 < 0) b10 = -b10; temp = temp / 2; }; { b11 = temp % 2; if (b11 < 0) b11 = -b11; temp = temp / 2; }; { b12 = temp % 2; if (b12 < 0) b12 = -b12; temp = temp / 2; }; { b13 = temp % 2; if (b13 < 0) b13 = -b13; temp = temp / 2; }; { b14 = temp % 2; if (b14 < 0) b14 = -b14; temp = temp / 2; }; { b15 = temp % 2; if (b15 < 0) b15 = -b15; temp = temp / 2; }; }; int c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; { int a_xor_b; { int a_or_b; { if ((a0) || (b0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s0 = 1; } else { s0 = 0; } }; }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c0 = 1; } else { c0 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a1) || (b1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s1 = 1; } else { s1 = 0; } }; }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c1 = 1; } else { c1 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a2) || (b2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s2 = 1; } else { s2 = 0; } }; }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c1)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c2 = 1; } else { c2 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a3) || (b3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s3 = 1; } else { s3 = 0; } }; }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c2)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c3 = 1; } else { c3 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a4) || (b4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s4 = 1; } else { s4 = 0; } }; }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c3)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c4 = 1; } else { c4 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a5) || (b5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s5 = 1; } else { s5 = 0; } }; }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c4)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c5 = 1; } else { c5 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a6) || (b6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s6 = 1; } else { s6 = 0; } }; }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c5)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c6 = 1; } else { c6 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a7) || (b7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s7 = 1; } else { s7 = 0; } }; }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c6)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c7 = 1; } else { c7 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a8) || (b8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s8 = 1; } else { s8 = 0; } }; }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c7)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c8 = 1; } else { c8 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a9) || (b9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s9 = 1; } else { s9 = 0; } }; }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c8)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c9 = 1; } else { c9 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a10) || (b10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s10 = 1; } else { s10 = 0; } }; }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c9)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c10 = 1; } else { c10 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a11) || (b11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s11 = 1; } else { s11 = 0; } }; }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c10)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c11 = 1; } else { c11 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a12) || (b12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s12 = 1; } else { s12 = 0; } }; }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c11)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c12 = 1; } else { c12 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a13) || (b13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s13 = 1; } else { s13 = 0; } }; }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c12)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c13 = 1; } else { c13 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a14) || (b14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s14 = 1; } else { s14 = 0; } }; }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c13)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c14 = 1; } else { c14 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a15) || (b15)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s15 = 1; } else { s15 = 0; } }; }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c14)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { cout = 1; } else { cout = 0; } }; }; { n1 = 0; n1 = n1 * 2 + (s15); n1 = n1 * 2 + (s14); n1 = n1 * 2 + (s13); n1 = n1 * 2 + (s12); n1 = n1 * 2 + (s11); n1 = n1 * 2 + (s10); n1 = n1 * 2 + (s9); n1 = n1 * 2 + (s8); n1 = n1 * 2 + (s7); n1 = n1 * 2 + (s6); n1 = n1 * 2 + (s5); n1 = n1 * 2 + (s4); n1 = n1 * 2 + (s3); n1 = n1 * 2 + (s2); n1 = n1 * 2 + (s1); n1 = n1 * 2 + (s0); }; }; }; }; int f1 = fib(n1); int n2; { int neg_b; { int not_a; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (2); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, o10, o11, o12, o13, o14, o15; { if (!(a0)) { o0 = 1; } else { o0 = 0; } }; { if (!(a1)) { o1 = 1; } else { o1 = 0; } }; { if (!(a2)) { o2 = 1; } else { o2 = 0; } }; { if (!(a3)) { o3 = 1; } else { o3 = 0; } }; { if (!(a4)) { o4 = 1; } else { o4 = 0; } }; { if (!(a5)) { o5 = 1; } else { o5 = 0; } }; { if (!(a6)) { o6 = 1; } else { o6 = 0; } }; { if (!(a7)) { o7 = 1; } else { o7 = 0; } }; { if (!(a8)) { o8 = 1; } else { o8 = 0; } }; { if (!(a9)) { o9 = 1; } else { o9 = 0; } }; { if (!(a10)) { o10 = 1; } else { o10 = 0; } }; { if (!(a11)) { o11 = 1; } else { o11 = 0; } }; { if (!(a12)) { o12 = 1; } else { o12 = 0; } }; { if (!(a13)) { o13 = 1; } else { o13 = 0; } }; { if (!(a14)) { o14 = 1; } else { o14 = 0; } }; { if (!(a15)) { o15 = 1; } else { o15 = 0; } }; { not_a = 0; not_a = not_a * 2 + (o15); not_a = not_a * 2 + (o14); not_a = not_a * 2 + (o13); not_a = not_a * 2 + (o12); not_a = not_a * 2 + (o11); not_a = not_a * 2 + (o10); not_a = not_a * 2 + (o9); not_a = not_a * 2 + (o8); not_a = not_a * 2 + (o7); not_a = not_a * 2 + (o6); not_a = not_a * 2 + (o5); not_a = not_a * 2 + (o4); not_a = not_a * 2 + (o3); not_a = not_a * 2 + (o2); not_a = not_a * 2 + (o1); not_a = not_a * 2 + (o0); }; }; { int cout; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (not_a); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; { int temp = (1); { b0 = temp % 2; if (b0 < 0) b0 = -b0; temp = temp / 2; }; { b1 = temp % 2; if (b1 < 0) b1 = -b1; temp = temp / 2; }; { b2 = temp % 2; if (b2 < 0) b2 = -b2; temp = temp / 2; }; { b3 = temp % 2; if (b3 < 0) b3 = -b3; temp = temp / 2; }; { b4 = temp % 2; if (b4 < 0) b4 = -b4; temp = temp / 2; }; { b5 = temp % 2; if (b5 < 0) b5 = -b5; temp = temp / 2; }; { b6 = temp % 2; if (b6 < 0) b6 = -b6; temp = temp / 2; }; { b7 = temp % 2; if (b7 < 0) b7 = -b7; temp = temp / 2; }; { b8 = temp % 2; if (b8 < 0) b8 = -b8; temp = temp / 2; }; { b9 = temp % 2; if (b9 < 0) b9 = -b9; temp = temp / 2; }; { b10 = temp % 2; if (b10 < 0) b10 = -b10; temp = temp / 2; }; { b11 = temp % 2; if (b11 < 0) b11 = -b11; temp = temp / 2; }; { b12 = temp % 2; if (b12 < 0) b12 = -b12; temp = temp / 2; }; { b13 = temp % 2; if (b13 < 0) b13 = -b13; temp = temp / 2; }; { b14 = temp % 2; if (b14 < 0) b14 = -b14; temp = temp / 2; }; { b15 = temp % 2; if (b15 < 0) b15 = -b15; temp = temp / 2; }; }; int c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; { int a_xor_b; { int a_or_b; { if ((a0) || (b0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s0 = 1; } else { s0 = 0; } }; }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c0 = 1; } else { c0 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a1) || (b1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s1 = 1; } else { s1 = 0; } }; }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c1 = 1; } else { c1 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a2) || (b2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s2 = 1; } else { s2 = 0; } }; }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c1)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c2 = 1; } else { c2 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a3) || (b3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s3 = 1; } else { s3 = 0; } }; }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c2)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c3 = 1; } else { c3 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a4) || (b4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s4 = 1; } else { s4 = 0; } }; }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c3)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c4 = 1; } else { c4 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a5) || (b5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s5 = 1; } else { s5 = 0; } }; }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c4)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c5 = 1; } else { c5 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a6) || (b6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s6 = 1; } else { s6 = 0; } }; }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c5)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c6 = 1; } else { c6 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a7) || (b7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s7 = 1; } else { s7 = 0; } }; }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c6)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c7 = 1; } else { c7 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a8) || (b8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s8 = 1; } else { s8 = 0; } }; }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c7)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c8 = 1; } else { c8 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a9) || (b9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s9 = 1; } else { s9 = 0; } }; }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c8)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c9 = 1; } else { c9 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a10) || (b10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s10 = 1; } else { s10 = 0; } }; }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c9)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c10 = 1; } else { c10 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a11) || (b11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s11 = 1; } else { s11 = 0; } }; }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c10)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c11 = 1; } else { c11 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a12) || (b12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s12 = 1; } else { s12 = 0; } }; }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c11)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c12 = 1; } else { c12 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a13) || (b13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s13 = 1; } else { s13 = 0; } }; }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c12)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c13 = 1; } else { c13 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a14) || (b14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s14 = 1; } else { s14 = 0; } }; }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c13)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c14 = 1; } else { c14 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a15) || (b15)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s15 = 1; } else { s15 = 0; } }; }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c14)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { cout = 1; } else { cout = 0; } }; }; { neg_b = 0; neg_b = neg_b * 2 + (s15); neg_b = neg_b * 2 + (s14); neg_b = neg_b * 2 + (s13); neg_b = neg_b * 2 + (s12); neg_b = neg_b * 2 + (s11); neg_b = neg_b * 2 + (s10); neg_b = neg_b * 2 + (s9); neg_b = neg_b * 2 + (s8); neg_b = neg_b * 2 + (s7); neg_b = neg_b * 2 + (s6); neg_b = neg_b * 2 + (s5); neg_b = neg_b * 2 + (s4); neg_b = neg_b * 2 + (s3); neg_b = neg_b * 2 + (s2); neg_b = neg_b * 2 + (s1); neg_b = neg_b * 2 + (s0); }; }; }; }; { int cout; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (n); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; { int temp = (neg_b); { b0 = temp % 2; if (b0 < 0) b0 = -b0; temp = temp / 2; }; { b1 = temp % 2; if (b1 < 0) b1 = -b1; temp = temp / 2; }; { b2 = temp % 2; if (b2 < 0) b2 = -b2; temp = temp / 2; }; { b3 = temp % 2; if (b3 < 0) b3 = -b3; temp = temp / 2; }; { b4 = temp % 2; if (b4 < 0) b4 = -b4; temp = temp / 2; }; { b5 = temp % 2; if (b5 < 0) b5 = -b5; temp = temp / 2; }; { b6 = temp % 2; if (b6 < 0) b6 = -b6; temp = temp / 2; }; { b7 = temp % 2; if (b7 < 0) b7 = -b7; temp = temp / 2; }; { b8 = temp % 2; if (b8 < 0) b8 = -b8; temp = temp / 2; }; { b9 = temp % 2; if (b9 < 0) b9 = -b9; temp = temp / 2; }; { b10 = temp % 2; if (b10 < 0) b10 = -b10; temp = temp / 2; }; { b11 = temp % 2; if (b11 < 0) b11 = -b11; temp = temp / 2; }; { b12 = temp % 2; if (b12 < 0) b12 = -b12; temp = temp / 2; }; { b13 = temp % 2; if (b13 < 0) b13 = -b13; temp = temp / 2; }; { b14 = temp % 2; if (b14 < 0) b14 = -b14; temp = temp / 2; }; { b15 = temp % 2; if (b15 < 0) b15 = -b15; temp = temp / 2; }; }; int c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; { int a_xor_b; { int a_or_b; { if ((a0) || (b0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s0 = 1; } else { s0 = 0; } }; }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c0 = 1; } else { c0 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a1) || (b1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s1 = 1; } else { s1 = 0; } }; }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c1 = 1; } else { c1 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a2) || (b2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s2 = 1; } else { s2 = 0; } }; }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c1)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c2 = 1; } else { c2 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a3) || (b3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s3 = 1; } else { s3 = 0; } }; }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c2)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c3 = 1; } else { c3 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a4) || (b4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s4 = 1; } else { s4 = 0; } }; }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c3)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c4 = 1; } else { c4 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a5) || (b5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s5 = 1; } else { s5 = 0; } }; }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c4)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c5 = 1; } else { c5 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a6) || (b6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s6 = 1; } else { s6 = 0; } }; }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c5)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c6 = 1; } else { c6 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a7) || (b7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s7 = 1; } else { s7 = 0; } }; }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c6)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c7 = 1; } else { c7 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a8) || (b8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s8 = 1; } else { s8 = 0; } }; }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c7)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c8 = 1; } else { c8 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a9) || (b9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s9 = 1; } else { s9 = 0; } }; }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c8)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c9 = 1; } else { c9 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a10) || (b10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s10 = 1; } else { s10 = 0; } }; }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c9)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c10 = 1; } else { c10 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a11) || (b11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s11 = 1; } else { s11 = 0; } }; }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c10)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c11 = 1; } else { c11 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a12) || (b12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s12 = 1; } else { s12 = 0; } }; }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c11)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c12 = 1; } else { c12 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a13) || (b13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s13 = 1; } else { s13 = 0; } }; }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c12)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c13 = 1; } else { c13 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a14) || (b14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s14 = 1; } else { s14 = 0; } }; }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c13)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c14 = 1; } else { c14 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a15) || (b15)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s15 = 1; } else { s15 = 0; } }; }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c14)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { cout = 1; } else { cout = 0; } }; }; { n2 = 0; n2 = n2 * 2 + (s15); n2 = n2 * 2 + (s14); n2 = n2 * 2 + (s13); n2 = n2 * 2 + (s12); n2 = n2 * 2 + (s11); n2 = n2 * 2 + (s10); n2 = n2 * 2 + (s9); n2 = n2 * 2 + (s8); n2 = n2 * 2 + (s7); n2 = n2 * 2 + (s6); n2 = n2 * 2 + (s5); n2 = n2 * 2 + (s4); n2 = n2 * 2 + (s3); n2 = n2 * 2 + (s2); n2 = n2 * 2 + (s1); n2 = n2 * 2 + (s0); }; }; }; }; int f2 = fib(n2); int ans; { int cout; { int a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14, a15; { int temp = (f1); { a0 = temp % 2; if (a0 < 0) a0 = -a0; temp = temp / 2; }; { a1 = temp % 2; if (a1 < 0) a1 = -a1; temp = temp / 2; }; { a2 = temp % 2; if (a2 < 0) a2 = -a2; temp = temp / 2; }; { a3 = temp % 2; if (a3 < 0) a3 = -a3; temp = temp / 2; }; { a4 = temp % 2; if (a4 < 0) a4 = -a4; temp = temp / 2; }; { a5 = temp % 2; if (a5 < 0) a5 = -a5; temp = temp / 2; }; { a6 = temp % 2; if (a6 < 0) a6 = -a6; temp = temp / 2; }; { a7 = temp % 2; if (a7 < 0) a7 = -a7; temp = temp / 2; }; { a8 = temp % 2; if (a8 < 0) a8 = -a8; temp = temp / 2; }; { a9 = temp % 2; if (a9 < 0) a9 = -a9; temp = temp / 2; }; { a10 = temp % 2; if (a10 < 0) a10 = -a10; temp = temp / 2; }; { a11 = temp % 2; if (a11 < 0) a11 = -a11; temp = temp / 2; }; { a12 = temp % 2; if (a12 < 0) a12 = -a12; temp = temp / 2; }; { a13 = temp % 2; if (a13 < 0) a13 = -a13; temp = temp / 2; }; { a14 = temp % 2; if (a14 < 0) a14 = -a14; temp = temp / 2; }; { a15 = temp % 2; if (a15 < 0) a15 = -a15; temp = temp / 2; }; }; int b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, b11, b12, b13, b14, b15; { int temp = (f2); { b0 = temp % 2; if (b0 < 0) b0 = -b0; temp = temp / 2; }; { b1 = temp % 2; if (b1 < 0) b1 = -b1; temp = temp / 2; }; { b2 = temp % 2; if (b2 < 0) b2 = -b2; temp = temp / 2; }; { b3 = temp % 2; if (b3 < 0) b3 = -b3; temp = temp / 2; }; { b4 = temp % 2; if (b4 < 0) b4 = -b4; temp = temp / 2; }; { b5 = temp % 2; if (b5 < 0) b5 = -b5; temp = temp / 2; }; { b6 = temp % 2; if (b6 < 0) b6 = -b6; temp = temp / 2; }; { b7 = temp % 2; if (b7 < 0) b7 = -b7; temp = temp / 2; }; { b8 = temp % 2; if (b8 < 0) b8 = -b8; temp = temp / 2; }; { b9 = temp % 2; if (b9 < 0) b9 = -b9; temp = temp / 2; }; { b10 = temp % 2; if (b10 < 0) b10 = -b10; temp = temp / 2; }; { b11 = temp % 2; if (b11 < 0) b11 = -b11; temp = temp / 2; }; { b12 = temp % 2; if (b12 < 0) b12 = -b12; temp = temp / 2; }; { b13 = temp % 2; if (b13 < 0) b13 = -b13; temp = temp / 2; }; { b14 = temp % 2; if (b14 < 0) b14 = -b14; temp = temp / 2; }; { b15 = temp % 2; if (b15 < 0) b15 = -b15; temp = temp / 2; }; }; int c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14; int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15; { int a_xor_b; { int a_or_b; { if ((a0) || (b0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s0 = 1; } else { s0 = 0; } }; }; int a_and_b; { if ((a0) && (b0)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c0 = 1; } else { c0 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a1) || (b1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c0)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c0)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s1 = 1; } else { s1 = 0; } }; }; int a_and_b; { if ((a1) && (b1)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c0)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c1 = 1; } else { c1 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a2) || (b2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c1)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c1)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s2 = 1; } else { s2 = 0; } }; }; int a_and_b; { if ((a2) && (b2)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c1)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c2 = 1; } else { c2 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a3) || (b3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c2)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c2)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s3 = 1; } else { s3 = 0; } }; }; int a_and_b; { if ((a3) && (b3)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c2)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c3 = 1; } else { c3 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a4) || (b4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c3)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c3)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s4 = 1; } else { s4 = 0; } }; }; int a_and_b; { if ((a4) && (b4)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c3)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c4 = 1; } else { c4 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a5) || (b5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c4)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c4)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s5 = 1; } else { s5 = 0; } }; }; int a_and_b; { if ((a5) && (b5)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c4)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c5 = 1; } else { c5 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a6) || (b6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c5)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c5)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s6 = 1; } else { s6 = 0; } }; }; int a_and_b; { if ((a6) && (b6)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c5)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c6 = 1; } else { c6 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a7) || (b7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c6)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c6)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s7 = 1; } else { s7 = 0; } }; }; int a_and_b; { if ((a7) && (b7)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c6)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c7 = 1; } else { c7 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a8) || (b8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c7)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c7)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s8 = 1; } else { s8 = 0; } }; }; int a_and_b; { if ((a8) && (b8)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c7)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c8 = 1; } else { c8 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a9) || (b9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c8)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c8)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s9 = 1; } else { s9 = 0; } }; }; int a_and_b; { if ((a9) && (b9)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c8)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c9 = 1; } else { c9 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a10) || (b10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c9)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c9)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s10 = 1; } else { s10 = 0; } }; }; int a_and_b; { if ((a10) && (b10)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c9)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c10 = 1; } else { c10 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a11) || (b11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c10)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c10)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s11 = 1; } else { s11 = 0; } }; }; int a_and_b; { if ((a11) && (b11)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c10)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c11 = 1; } else { c11 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a12) || (b12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c11)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c11)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s12 = 1; } else { s12 = 0; } }; }; int a_and_b; { if ((a12) && (b12)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c11)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c12 = 1; } else { c12 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a13) || (b13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c12)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c12)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s13 = 1; } else { s13 = 0; } }; }; int a_and_b; { if ((a13) && (b13)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c12)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c13 = 1; } else { c13 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a14) || (b14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c13)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c13)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s14 = 1; } else { s14 = 0; } }; }; int a_and_b; { if ((a14) && (b14)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c13)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { c14 = 1; } else { c14 = 0; } }; }; { int a_xor_b; { int a_or_b; { if ((a15) || (b15)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { a_xor_b = 1; } else { a_xor_b = 0; } }; }; { int a_or_b; { if ((a_xor_b) || (c14)) { a_or_b = 1; } else { a_or_b = 0; } }; int a_and_b; { if ((a_xor_b) && (c14)) { a_and_b = 1; } else { a_and_b = 0; } }; int a_nand_b; { if (!(a_and_b)) { a_nand_b = 1; } else { a_nand_b = 0; } }; { if ((a_or_b) && (a_nand_b)) { s15 = 1; } else { s15 = 0; } }; }; int a_and_b; { if ((a15) && (b15)) { a_and_b = 1; } else { a_and_b = 0; } }; int ab_and_cin; { if ((a_xor_b) && (c14)) { ab_and_cin = 1; } else { ab_and_cin = 0; } }; { if ((a_and_b) || (ab_and_cin)) { cout = 1; } else { cout = 0; } }; }; { ans = 0; ans = ans * 2 + (s15); ans = ans * 2 + (s14); ans = ans * 2 + (s13); ans = ans * 2 + (s12); ans = ans * 2 + (s11); ans = ans * 2 + (s10); ans = ans * 2 + (s9); ans = ans * 2 + (s8); ans = ans * 2 + (s7); ans = ans * 2 + (s6); ans = ans * 2 + (s5); ans = ans * 2 + (s4); ans = ans * 2 + (s3); ans = ans * 2 + (s2); ans = ans * 2 + (s1); ans = ans * 2 + (s0); }; }; }; return ans; } int main() { int i = 1; while (i <= 20) { putch(102); putch(105); putch(98); putch(40); putint(i); putch(41); putch(32); putch(61); putch(32); putint(fib(i)); putch(10); i = i + 1; } return 0; } diff --git a/hidden_functional_c/sy/30_many_dimensions.sy b/hidden_functional_c/sy/30_many_dimensions.sy index 80e8105..65416cf 100644 --- a/hidden_functional_c/sy/30_many_dimensions.sy +++ b/hidden_functional_c/sy/30_many_dimensions.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int sum(int a0[], int a1[][2], int a2[][2][2], int a3[][2][2][2], int a4[][2][2][2][2], int a5[][2][2][2][2][2], int a6[][2][2][2][2][2][2], int a7[][2][2][2][2][2][2][2], int a8[][2][2][2][2][2][2][2][2], int a9[][2][2][2][2][2][2][2][2][2], int a10[][2][2][2][2][2][2][2][2][2][2], diff --git a/hidden_functional_c/sy/31_many_indirections.sy b/hidden_functional_c/sy/31_many_indirections.sy index 9d399a3..eb668c6 100644 --- a/hidden_functional_c/sy/31_many_indirections.sy +++ b/hidden_functional_c/sy/31_many_indirections.sy @@ -1,3 +1,4 @@ +#include "sylib.h" #define N 100 #define M 20 int array[M][N]; diff --git a/hidden_functional_c/sy/32_many_params3.sy b/hidden_functional_c/sy/32_many_params3.sy index 4878fe1..6c7e147 100644 --- a/hidden_functional_c/sy/32_many_params3.sy +++ b/hidden_functional_c/sy/32_many_params3.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int func(int aa, int ab, int ac, int ad, int ae, int af, int ag, int ah, int ai, int aj, int ak, int al, int am, int an, int ao, int ap, int aq, int ar, int as, int at, int au, int av, int aw, int ax, int ay, int az, int ba, int bb, int bc, int bd, int be, int bf, int bg, int bh, int bi, int bj, int bk, int bl, int bm, int bn, int bo, int bp, int bq, int br, int bs, int bt, int bu, int bv, int bw, int bx, int by, int bz, int ca, int cb, int cc, int cd, int ce, int cf, int cg, int ch, int ci, int cj, int ck, int cl, int cm, int cn, int co, int cp, int cq, int cr, int cs, int ct, int cu, int cv, int cw, int cx, int cy, int cz, diff --git a/hidden_functional_c/sy/33_multi_branch.sy b/hidden_functional_c/sy/33_multi_branch.sy index 1ae8a12..0b0706e 100644 --- a/hidden_functional_c/sy/33_multi_branch.sy +++ b/hidden_functional_c/sy/33_multi_branch.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a, res, n; n = getint(); diff --git a/hidden_functional_c/sy/34_multi_loop.sy b/hidden_functional_c/sy/34_multi_loop.sy index d0fa469..235631a 100644 --- a/hidden_functional_c/sy/34_multi_loop.sy +++ b/hidden_functional_c/sy/34_multi_loop.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int main() { int a=0; int i = 0; diff --git a/hidden_functional_c/sy/35_math.sy b/hidden_functional_c/sy/35_math.sy index 03ab005..5c0739b 100644 --- a/hidden_functional_c/sy/35_math.sy +++ b/hidden_functional_c/sy/35_math.sy @@ -1,3 +1,4 @@ +#include "sylib.h" // reference: https://zhuanlan.zhihu.com/p/20085048 const float e = 2.718281828459045; diff --git a/hidden_functional_c/sy/39_fp_params.sy b/hidden_functional_c/sy/39_fp_params.sy index b474af1..ceabf3a 100644 --- a/hidden_functional_c/sy/39_fp_params.sy +++ b/hidden_functional_c/sy/39_fp_params.sy @@ -1,3 +1,4 @@ +#include "sylib.h" int k; float params_f40(float x0, float x1, float x2, float x3, float x4, float x5, diff --git a/performance_c/sy/00_bitset1.sy b/performance_c/sy/00_bitset1.sy index 657b608..c69c1a1 100644 --- a/performance_c/sy/00_bitset1.sy +++ b/performance_c/sy/00_bitset1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int set(int a[], int pos, int d){ #define bitcount 30 int x[bitcount + 1] = {}; diff --git a/performance_c/sy/00_bitset2.sy b/performance_c/sy/00_bitset2.sy index 657b608..c69c1a1 100644 --- a/performance_c/sy/00_bitset2.sy +++ b/performance_c/sy/00_bitset2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int set(int a[], int pos, int d){ #define bitcount 30 int x[bitcount + 1] = {}; diff --git a/performance_c/sy/00_bitset3.sy b/performance_c/sy/00_bitset3.sy index 657b608..c69c1a1 100644 --- a/performance_c/sy/00_bitset3.sy +++ b/performance_c/sy/00_bitset3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int set(int a[], int pos, int d){ #define bitcount 30 int x[bitcount + 1] = {}; diff --git a/performance_c/sy/01_mm1.sy b/performance_c/sy/01_mm1.sy index a6e5fce..72cf02a 100644 --- a/performance_c/sy/01_mm1.sy +++ b/performance_c/sy/01_mm1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define N 1024 void mm(int n, int A[][N], int B[][N], int C[][N]){ diff --git a/performance_c/sy/01_mm2.sy b/performance_c/sy/01_mm2.sy index a6e5fce..72cf02a 100644 --- a/performance_c/sy/01_mm2.sy +++ b/performance_c/sy/01_mm2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define N 1024 void mm(int n, int A[][N], int B[][N], int C[][N]){ diff --git a/performance_c/sy/01_mm3.sy b/performance_c/sy/01_mm3.sy index a6e5fce..72cf02a 100644 --- a/performance_c/sy/01_mm3.sy +++ b/performance_c/sy/01_mm3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define N 1024 void mm(int n, int A[][N], int B[][N], int C[][N]){ diff --git a/performance_c/sy/02_mv1.sy b/performance_c/sy/02_mv1.sy index 454ed74..8d2965c 100644 --- a/performance_c/sy/02_mv1.sy +++ b/performance_c/sy/02_mv1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int x; #define N 2010 diff --git a/performance_c/sy/02_mv2.sy b/performance_c/sy/02_mv2.sy index 454ed74..8d2965c 100644 --- a/performance_c/sy/02_mv2.sy +++ b/performance_c/sy/02_mv2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int x; #define N 2010 diff --git a/performance_c/sy/02_mv3.sy b/performance_c/sy/02_mv3.sy index 454ed74..8d2965c 100644 --- a/performance_c/sy/02_mv3.sy +++ b/performance_c/sy/02_mv3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int x; #define N 2010 diff --git a/performance_c/sy/03_sort1.sy b/performance_c/sy/03_sort1.sy index 4a29deb..2b8f834 100644 --- a/performance_c/sy/03_sort1.sy +++ b/performance_c/sy/03_sort1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define base 16 int getMaxNum(int n, int arr[]){ diff --git a/performance_c/sy/03_sort2.sy b/performance_c/sy/03_sort2.sy index 4a29deb..2b8f834 100644 --- a/performance_c/sy/03_sort2.sy +++ b/performance_c/sy/03_sort2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define base 16 int getMaxNum(int n, int arr[]){ diff --git a/performance_c/sy/03_sort3.sy b/performance_c/sy/03_sort3.sy index 4a29deb..2b8f834 100644 --- a/performance_c/sy/03_sort3.sy +++ b/performance_c/sy/03_sort3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define base 16 int getMaxNum(int n, int arr[]){ diff --git a/performance_c/sy/04_spmv1.sy b/performance_c/sy/04_spmv1.sy index 0b5423e..1cef764 100644 --- a/performance_c/sy/04_spmv1.sy +++ b/performance_c/sy/04_spmv1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ int i, j, k; i = 0; diff --git a/performance_c/sy/04_spmv2.sy b/performance_c/sy/04_spmv2.sy index 0b5423e..1cef764 100644 --- a/performance_c/sy/04_spmv2.sy +++ b/performance_c/sy/04_spmv2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ int i, j, k; i = 0; diff --git a/performance_c/sy/04_spmv3.sy b/performance_c/sy/04_spmv3.sy index 0b5423e..1cef764 100644 --- a/performance_c/sy/04_spmv3.sy +++ b/performance_c/sy/04_spmv3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" void spmv(int n,int xptr[], int yidx[], int vals[], int b[], int x[]){ int i, j, k; i = 0; diff --git a/performance_c/sy/brainfuck-bootstrap.sy b/performance_c/sy/brainfuck-bootstrap.sy index 46666ac..d58e82b 100644 --- a/performance_c/sy/brainfuck-bootstrap.sy +++ b/performance_c/sy/brainfuck-bootstrap.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" // Brainfuck Interpreter // Reads program from stdin, interprets and outputs to stdout. // diff --git a/performance_c/sy/brainfuck-mandelbrot-nerf.sy b/performance_c/sy/brainfuck-mandelbrot-nerf.sy index 9776b21..c5e6166 100644 --- a/performance_c/sy/brainfuck-mandelbrot-nerf.sy +++ b/performance_c/sy/brainfuck-mandelbrot-nerf.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" // Brainfuck Interpreter // Reads program from stdin, interprets and outputs to stdout. // diff --git a/performance_c/sy/brainfuck-pi-nerf.sy b/performance_c/sy/brainfuck-pi-nerf.sy index 9776b21..c5e6166 100644 --- a/performance_c/sy/brainfuck-pi-nerf.sy +++ b/performance_c/sy/brainfuck-pi-nerf.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" // Brainfuck Interpreter // Reads program from stdin, interprets and outputs to stdout. // diff --git a/performance_c/sy/conv0.sy b/performance_c/sy/conv0.sy index e4e68f3..9132e28 100644 --- a/performance_c/sy/conv0.sy +++ b/performance_c/sy/conv0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define max 1073741824 int checkrange(int num){ while (num > max) num = num - max; diff --git a/performance_c/sy/conv1.sy b/performance_c/sy/conv1.sy index e4e68f3..9132e28 100644 --- a/performance_c/sy/conv1.sy +++ b/performance_c/sy/conv1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define max 1073741824 int checkrange(int num){ while (num > max) num = num - max; diff --git a/performance_c/sy/conv2.sy b/performance_c/sy/conv2.sy index e4e68f3..9132e28 100644 --- a/performance_c/sy/conv2.sy +++ b/performance_c/sy/conv2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define max 1073741824 int checkrange(int num){ while (num > max) num = num - max; diff --git a/performance_c/sy/crypto-1.sy b/performance_c/sy/crypto-1.sy index 00f7b55..ec633f4 100644 --- a/performance_c/sy/crypto-1.sy +++ b/performance_c/sy/crypto-1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int state = 19260817; diff --git a/performance_c/sy/crypto-2.sy b/performance_c/sy/crypto-2.sy index 00f7b55..ec633f4 100644 --- a/performance_c/sy/crypto-2.sy +++ b/performance_c/sy/crypto-2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int state = 19260817; diff --git a/performance_c/sy/crypto-3.sy b/performance_c/sy/crypto-3.sy index 00f7b55..ec633f4 100644 --- a/performance_c/sy/crypto-3.sy +++ b/performance_c/sy/crypto-3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int state = 19260817; diff --git a/performance_c/sy/dead-code-elimination-1.sy b/performance_c/sy/dead-code-elimination-1.sy index f170f60..5d32394 100644 --- a/performance_c/sy/dead-code-elimination-1.sy +++ b/performance_c/sy/dead-code-elimination-1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc dead-code-elimination.c sylib.c -include sylib.h -Wall -Wno-unused-result -Wno-unused-variable -o binary-dead-code-elimination && time ./binary-dead-code-elimination < dead-code-elimination.in int loopCount = 0; int global = 0; diff --git a/performance_c/sy/dead-code-elimination-2.sy b/performance_c/sy/dead-code-elimination-2.sy index f170f60..5d32394 100644 --- a/performance_c/sy/dead-code-elimination-2.sy +++ b/performance_c/sy/dead-code-elimination-2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc dead-code-elimination.c sylib.c -include sylib.h -Wall -Wno-unused-result -Wno-unused-variable -o binary-dead-code-elimination && time ./binary-dead-code-elimination < dead-code-elimination.in int loopCount = 0; int global = 0; diff --git a/performance_c/sy/dead-code-elimination-3.sy b/performance_c/sy/dead-code-elimination-3.sy index f170f60..5d32394 100644 --- a/performance_c/sy/dead-code-elimination-3.sy +++ b/performance_c/sy/dead-code-elimination-3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc dead-code-elimination.c sylib.c -include sylib.h -Wall -Wno-unused-result -Wno-unused-variable -o binary-dead-code-elimination && time ./binary-dead-code-elimination < dead-code-elimination.in int loopCount = 0; int global = 0; diff --git a/performance_c/sy/fft0.sy b/performance_c/sy/fft0.sy index 57516e8..143b0d2 100644 --- a/performance_c/sy/fft0.sy +++ b/performance_c/sy/fft0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define mod 998244353 int d; diff --git a/performance_c/sy/fft1.sy b/performance_c/sy/fft1.sy index 57516e8..143b0d2 100644 --- a/performance_c/sy/fft1.sy +++ b/performance_c/sy/fft1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define mod 998244353 int d; diff --git a/performance_c/sy/fft2.sy b/performance_c/sy/fft2.sy index 57516e8..143b0d2 100644 --- a/performance_c/sy/fft2.sy +++ b/performance_c/sy/fft2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define mod 998244353 int d; diff --git a/performance_c/sy/floyd-0.sy b/performance_c/sy/floyd-0.sy index 9f089d1..c083543 100644 --- a/performance_c/sy/floyd-0.sy +++ b/performance_c/sy/floyd-0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define maxlen 2097152 int temp[maxlen], w[maxlen], dst[maxlen], c[maxlen]; diff --git a/performance_c/sy/floyd-1.sy b/performance_c/sy/floyd-1.sy index 9f089d1..c083543 100644 --- a/performance_c/sy/floyd-1.sy +++ b/performance_c/sy/floyd-1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define maxlen 2097152 int temp[maxlen], w[maxlen], dst[maxlen], c[maxlen]; diff --git a/performance_c/sy/floyd-2.sy b/performance_c/sy/floyd-2.sy index 9f089d1..c083543 100644 --- a/performance_c/sy/floyd-2.sy +++ b/performance_c/sy/floyd-2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define maxlen 2097152 int temp[maxlen], w[maxlen], dst[maxlen], c[maxlen]; diff --git a/performance_c/sy/gameoflife-gosper.sy b/performance_c/sy/gameoflife-gosper.sy index 01b8886..2206ff5 100644 --- a/performance_c/sy/gameoflife-gosper.sy +++ b/performance_c/sy/gameoflife-gosper.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int sheet1[500][500] = {}; int sheet2[500][500] = {}; int active = 1; diff --git a/performance_c/sy/gameoflife-oscillator.sy b/performance_c/sy/gameoflife-oscillator.sy index a992562..177afbb 100644 --- a/performance_c/sy/gameoflife-oscillator.sy +++ b/performance_c/sy/gameoflife-oscillator.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int sheet1[500][500] = {}; int sheet2[500][500] = {}; int active = 1; diff --git a/performance_c/sy/gameoflife-p61glidergun.sy b/performance_c/sy/gameoflife-p61glidergun.sy index a992562..177afbb 100644 --- a/performance_c/sy/gameoflife-p61glidergun.sy +++ b/performance_c/sy/gameoflife-p61glidergun.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int sheet1[500][500] = {}; int sheet2[500][500] = {}; int active = 1; diff --git a/performance_c/sy/hoist-1.sy b/performance_c/sy/hoist-1.sy index 5b63318..28867f4 100644 --- a/performance_c/sy/hoist-1.sy +++ b/performance_c/sy/hoist-1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc hoist.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-hoist && time ./binary-hoist < hoist.in int loopCount = 0; int func(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15) diff --git a/performance_c/sy/hoist-2.sy b/performance_c/sy/hoist-2.sy index 5b63318..28867f4 100644 --- a/performance_c/sy/hoist-2.sy +++ b/performance_c/sy/hoist-2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc hoist.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-hoist && time ./binary-hoist < hoist.in int loopCount = 0; int func(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15) diff --git a/performance_c/sy/hoist-3.sy b/performance_c/sy/hoist-3.sy index 5b63318..28867f4 100644 --- a/performance_c/sy/hoist-3.sy +++ b/performance_c/sy/hoist-3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc hoist.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-hoist && time ./binary-hoist < hoist.in int loopCount = 0; int func(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9, int i10, int i11, int i12, int i13, int i14, int i15) diff --git a/performance_c/sy/instruction-combining-1.sy b/performance_c/sy/instruction-combining-1.sy index 4171e67..bdbc24d 100644 --- a/performance_c/sy/instruction-combining-1.sy +++ b/performance_c/sy/instruction-combining-1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc instruction-combining.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-instruction-combining && time ./binary-instruction-combining < instruction-combining.in int loopCount = 0; diff --git a/performance_c/sy/instruction-combining-2.sy b/performance_c/sy/instruction-combining-2.sy index 4171e67..bdbc24d 100644 --- a/performance_c/sy/instruction-combining-2.sy +++ b/performance_c/sy/instruction-combining-2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc instruction-combining.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-instruction-combining && time ./binary-instruction-combining < instruction-combining.in int loopCount = 0; diff --git a/performance_c/sy/instruction-combining-3.sy b/performance_c/sy/instruction-combining-3.sy index 4171e67..bdbc24d 100644 --- a/performance_c/sy/instruction-combining-3.sy +++ b/performance_c/sy/instruction-combining-3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc instruction-combining.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-instruction-combining && time ./binary-instruction-combining < instruction-combining.in int loopCount = 0; diff --git a/performance_c/sy/integer-divide-optimization-1.sy b/performance_c/sy/integer-divide-optimization-1.sy index bb5d5c1..112c683 100644 --- a/performance_c/sy/integer-divide-optimization-1.sy +++ b/performance_c/sy/integer-divide-optimization-1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc integer-divide-optimization.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-integer-divide-optimization && time ./binary-integer-divide-optimization < integer-divide-optimization.in int loopCount = 0; int multi = 2; diff --git a/performance_c/sy/integer-divide-optimization-2.sy b/performance_c/sy/integer-divide-optimization-2.sy index bb5d5c1..112c683 100644 --- a/performance_c/sy/integer-divide-optimization-2.sy +++ b/performance_c/sy/integer-divide-optimization-2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc integer-divide-optimization.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-integer-divide-optimization && time ./binary-integer-divide-optimization < integer-divide-optimization.in int loopCount = 0; int multi = 2; diff --git a/performance_c/sy/integer-divide-optimization-3.sy b/performance_c/sy/integer-divide-optimization-3.sy index bb5d5c1..112c683 100644 --- a/performance_c/sy/integer-divide-optimization-3.sy +++ b/performance_c/sy/integer-divide-optimization-3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" //gcc integer-divide-optimization.c sylib.c -include sylib.h -Wall -Wno-unused-result -o binary-integer-divide-optimization && time ./binary-integer-divide-optimization < integer-divide-optimization.in int loopCount = 0; int multi = 2; diff --git a/performance_c/sy/median0.sy b/performance_c/sy/median0.sy index 688fc17..ae9d8e7 100644 --- a/performance_c/sy/median0.sy +++ b/performance_c/sy/median0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int n; int meanless_calculation(int x, int y){ int i = 0; diff --git a/performance_c/sy/median1.sy b/performance_c/sy/median1.sy index 688fc17..ae9d8e7 100644 --- a/performance_c/sy/median1.sy +++ b/performance_c/sy/median1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int n; int meanless_calculation(int x, int y){ int i = 0; diff --git a/performance_c/sy/median2.sy b/performance_c/sy/median2.sy index 688fc17..ae9d8e7 100644 --- a/performance_c/sy/median2.sy +++ b/performance_c/sy/median2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int n; int meanless_calculation(int x, int y){ int i = 0; diff --git a/performance_c/sy/shuffle0.sy b/performance_c/sy/shuffle0.sy index 0974e19..5e73d23 100644 --- a/performance_c/sy/shuffle0.sy +++ b/performance_c/sy/shuffle0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int hashmod; #define maxn 10000000 diff --git a/performance_c/sy/shuffle1.sy b/performance_c/sy/shuffle1.sy index 0974e19..5e73d23 100644 --- a/performance_c/sy/shuffle1.sy +++ b/performance_c/sy/shuffle1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int hashmod; #define maxn 10000000 diff --git a/performance_c/sy/shuffle2.sy b/performance_c/sy/shuffle2.sy index 0974e19..5e73d23 100644 --- a/performance_c/sy/shuffle2.sy +++ b/performance_c/sy/shuffle2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int hashmod; #define maxn 10000000 diff --git a/performance_c/sy/sl1.sy b/performance_c/sy/sl1.sy index f9d9da0..ac6ab33 100644 --- a/performance_c/sy/sl1.sy +++ b/performance_c/sy/sl1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int x[600][600][600]; int y[600][600][600]; diff --git a/performance_c/sy/sl2.sy b/performance_c/sy/sl2.sy index f9d9da0..ac6ab33 100644 --- a/performance_c/sy/sl2.sy +++ b/performance_c/sy/sl2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int x[600][600][600]; int y[600][600][600]; diff --git a/performance_c/sy/sl3.sy b/performance_c/sy/sl3.sy index f9d9da0..ac6ab33 100644 --- a/performance_c/sy/sl3.sy +++ b/performance_c/sy/sl3.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int x[600][600][600]; int y[600][600][600]; diff --git a/performance_c/sy/stencil0.sy b/performance_c/sy/stencil0.sy index 0cb4ec3..a1a5eb9 100644 --- a/performance_c/sy/stencil0.sy +++ b/performance_c/sy/stencil0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define width 512 #define height 1024 int image_in[width * height]; diff --git a/performance_c/sy/stencil1.sy b/performance_c/sy/stencil1.sy index f2bef1a..6c41597 100644 --- a/performance_c/sy/stencil1.sy +++ b/performance_c/sy/stencil1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" #define width 1024 #define height 1024 int image_in[width * height]; diff --git a/performance_c/sy/transpose0.sy b/performance_c/sy/transpose0.sy index e6d9e56..637492b 100644 --- a/performance_c/sy/transpose0.sy +++ b/performance_c/sy/transpose0.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int matrix[20000000]; int a[100000]; diff --git a/performance_c/sy/transpose1.sy b/performance_c/sy/transpose1.sy index e6d9e56..637492b 100644 --- a/performance_c/sy/transpose1.sy +++ b/performance_c/sy/transpose1.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int matrix[20000000]; int a[100000]; diff --git a/performance_c/sy/transpose2.sy b/performance_c/sy/transpose2.sy index 9e5d366..a7ff3cb 100644 --- a/performance_c/sy/transpose2.sy +++ b/performance_c/sy/transpose2.sy @@ -1,4 +1,5 @@ #include "sylib.h" +#include "sylib.h" int matrix[20000000]; int a[100000]; diff --git a/scripts/add_incs.sh b/scripts/add_incs.sh new file mode 100644 index 0000000..0bdcb00 --- /dev/null +++ b/scripts/add_incs.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# Specify the directory +dir="." + +# Loop over all .sy files in the directory +find "$dir"/*/sy -type f -name "*.sy" -print0 | while IFS= read -r -d '' file; do + # Use sed to add #include "sylib.h" at the beginning of each file + sed -i '1i#include "sylib.h"' "$file" +done diff --git a/scripts/inc.sh b/scripts/inc.sh deleted file mode 100644 index 04dfee3..0000000 --- a/scripts/inc.sh +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash - -# 遍历当前目录下的所有.c文件 -for file in sy/*.c; do - # 检查文件是否存在 - if [ -f "$file" ]; then - # 向每个文件的开头添加#include "sylib.h" - sed -i '1s/^/#include "sylib.h"\n/' "$file" - fi -done \ No newline at end of file