tangga naik ke atas
#include <stdio.h>
int main()
{
int i;
int j;
int n;
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(j=1;j<=n;j++)
{
if(i+j == n+1)
{
printf("*");
}
else
{
printf(" ");
}
}
printf("\n");
}
return 0;
}
#include <stdio.h>
int
main ()
{
int i;
int j;
int n;
scanf ("%d", &n);
int spasi = n;
for (i = 0; i < n; i++)
{
for (j = spasi; j >0; j--)
{
printf(" ");
}
printf("*");
printf ("\n");
spasi = spasi-1;
}
return 0;
}
Komentar
Posting Komentar