『代码』··By/蜜汁炒酸奶

打印宝石

/* 功能:打印宝石 日期:2013-05-08 */ #include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { int line,count; for(line = 1;line<=3;line++) { for (count=3;count<=7-2*(line-1);count+=2) { printf(" “); } for (count=1;count<=2*line-1;count+=1) { printf(”*“); } printf(“n”); } for (line = 1;line<=5;line++) { for(count=1;count<line;count++) { printf(” “); } for(count=1;count<=7-2*(line-1);count++) { printf(”*"); } printf(“n”); } printf(“n”); system(“pause”); return 0; }

预览
Loading comments...
0 条评论

暂无数据

example
预览