Write a program using for loops to produce a hollow box using the asterisk (*) symbol. The program should prompt the user for the height of the hollow box and check to see that the user entered a number greater than or equal to 3 and less than or equal to 40. If the user enters an invalid number, the program will print an error message and exit. If the user enters a valid number the program will print a hollow box of height and width n, where n is the number the user entered at the console.
我很乱
我是新手。。。。
谢谢
如果有人愿意帮我
麻烦
pm我
我给你我的msn。。。
- #include <stdio.h>
- int main()
- {
- int i,j,k;
- printf("Enter a value:\n");
- scanf("%d", &i,j,k);
- {
- for(i=0; i<=3; i++)
- for(j=0; j>=40; j--)
- printf(" ");
- {
- for(k=1; k<=i; k=k+1)
- printf("*");
- printf("\n");
- }
- }
- }
复制代码
[
本帖最后由 ぁあぃ← 于 2009-10-8 10:13 PM 编辑 ]