level 1
第一题Write a C program to do the followings:•Ask the user to print pattern 1 or 2 using switch•Ask the user to input the size of the pattern•Use for loops to generate the pattern.Pattern 1Pattern 2***** ***** **** **** *** ***** ** * * The program should follow the sample output.Which pattern do you want to print (1,2)?1Size of the pattern:4**********Which pattern do you want to print (1,2)?2Size of the pattern:4**** *** ** *Which pattern do you want to print (1,2)?6Size of the pattern:4Do not have this pattern.第二题Modify the previous program so that the program can print pattern 3 and 4. (You can also add other kinds of patterns here if you can imagine)Pattern 3Pattern 4 * * ** * *** * **** * ***** * The program should follow the sample output.Which pattern do you want to print (1,2,3,4)?3Size of the pattern:4 * ** *******Which pattern do you want to print (1,2,3,4)?4Size of the pattern:4 * * **
2008年02月12日 14点02分
1