30 lines
468 B
C
30 lines
468 B
C
#include <stdio.h>
|
|
|
|
int main(int argc, char const *argv[])
|
|
{
|
|
int input;
|
|
printf("Digite um número:\n");
|
|
|
|
if (scanf("%d", &input) != 1) {
|
|
return 1;
|
|
}
|
|
if (input < 0) {
|
|
printf("Digite um número positivo!");
|
|
return 1;
|
|
}
|
|
|
|
int k = 1;
|
|
for (int i = 0; i < input; i++)
|
|
{
|
|
for (int j = 0; j < k; j++)
|
|
{
|
|
printf("* ");
|
|
}
|
|
printf("\n");
|
|
k++;
|
|
}
|
|
|
|
|
|
return 0;
|
|
}
|