#include <stdio.h> int main() { /* * ** *** **** ***** */ for(int a=0;a<5;a++) { printf("\n"); //当a=0; b<1 //当a=1; b<2 //当a=2; b<3 for(int b=0;b<a+1;b++)//1,2,3,4,5 { printf("*"); } } /* ***** **** *** ** * */ printf("\n\n"); for(int c=0;c<5;c++) { printf("\n"); //第一行时候c=0,d=5 //第二行时候c=1,d=4 //第三行时候c=2,d=3 //规律 -----d = 5-c for(int d=0;d<5-c;d++) { printf("*"); } } /* ***** * * ***** ** ** ***** *** *** ***** **** **** ***** ***** ***** */ printf("\n\n"); //第一行e=0;有4个空格 //第二行e=1;有3个空格 //第三行e=2;有2个空格 //第四行e=3;有1个空格 //第五行e=4;有0个空格 // #### // ### // ## // # for(int e=0;e<5;e++) { printf("\n"); //打印空格的循环 for(int g=0;g<4-e;g++) { printf(" "); } //打印*的for循环 for(int f=0;f<e+1;f++) { printf("*"); } } /* ***** **** *** ** * */ //空格的规律 //当i=0 ;有0个空格 //当i=1 ;有1个空格 //当i=2 ;有2个空格 //*号的规律 //当i=0,有5个* //当i=1,有4个* //当i=2,有3个* printf("\n\n"); for(int i=0;i<5;i++) { printf("\n"); //打印空格的循环 for(int j=0;j<i;j++) { printf(" "); } //打印*的循环 for(int k=0;k<5-i;k++) { printf("*"); } } printf("\n\n"); //9*9乘法表 for(int m=1;m<10;m++) { printf("\n"); //第一行m=0;n=1; //第二行m=1;n=2 //第三行m=2;n=3 for(int n=1;n<m+1;n++) { printf("%d*%d=%3d ",n,m,n*m); } } float q= 6.3; printf("q=%6.2f",q); return 0; }
#include stdio.h(3)
猜你喜欢
转载自www.cnblogs.com/lishch/p/9329811.html
今日推荐
周排行