第七次随笔

1,

输出正三角

#include<stdio.h>

main(){

 

       int i,j;

       for(i=1;i<=6;i++){

              for(j=1;j<=i;j++){

                     printf("*");

              }

              printf("\n");

       }

 

 

输出倒三角

#include<stdio.h>

main(){

      int i,j;

      for(i=1;i<=5;i++){

            for(j=1;j<=6-i;j++){

                  printf("*");

            }

            printf("\n");

      }

}

 

 

 

#include<stdio.h>

main()

       {

       int x,y;

       for(x=0;x<=35;x++)

{

y=35-x;

if(2*x+4*y==94)

printf("鸡:%d只 兔子:%d只\n",x,y);

 

 

#include<stdio.h>

main(){

       int i,j;

       for(i=1;i<=9;i++){

              for(j=1;j<=i;j++){

                     printf("%d*%d=%d\t",i,j,i*j);

              }

              printf("\n");

       }

 

 

}

 

posted @ 2021-11-09 10:29  1只会飞猪  阅读(20)  评论(0编辑  收藏  举报