/* 功能:打印宝石 日期: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; }