C語言(online c) (列印出3個 圖形)
#include<stdio.h>
#include<math.h>
int main()
{
printf("\t\t印出 3個圖形\n");
for (int i=1;i<=5;i++)
{
for(int j=1;j<=i;j++)
{
printf("●");
}
printf("\n");
}
printf("\n");
for (int i=1;i<=5;i++)
{
for(int j=1;j<=5-i;j++)
printf(" ");
for (int j=1;j<=i;j++)
printf("●");
printf("\n");
}
printf("\n");
for (int i=1;i<=5;i=i+2)
{
for(int j=1;j<=5-i;j=j+2)
printf(" ");
for (int j=1;j<=i;j++)
printf("●");
printf("\n");
}
return 0;
}
沒有留言:
張貼留言