CS P-set 1 - pset 1 solution PDF

Title CS P-set 1 - pset 1 solution
Author Thuy Pham
Course Introduction to Computer Science
Institution Harvard University
Pages 4
File Size 62.5 KB
File Type PDF
Total Downloads 87
Total Views 169

Summary

pset 1 solution...


Description

#include #include int main(void) { int Height = get_int("Height: "); if (Height == 8) { printf(" # # \n ## ## \n ### ### \n #### #### \n ##### ##### \n ###### ###### \n ####### ####### \n######## ########\n"); } else if (Height == 7) { printf(" # # \n ## ## \n ### ### \n #### #### \n ##### ##### \n ###### ###### \n####### #######\n"); } else if (Height == 6) { printf(" # # \n ## ## \n ### ### \n #### #### \n ##### ##### \n######\n"); } else if (Height == 5) { printf(" # # \n ## ## \n ### ### \n #### #### \n##### #####\n"); } else if (Height == 4) { printf(" # # \n ## ## \n ### ### \n#### ####\n"); } else if (Height == 3) { printf(" # # \n ## ## \n### ###\n"); } else if (Height == 2) { printf(" # # \n## ##\n"); } else if (Height == 1) { printf("# #\n"); } else { get_int("Height: "); } } END

#include #include

int main(void) { int height = get_int("Height: "); while (height>8 || height...


Similar Free PDFs