add l7.c
This commit is contained in:
parent
72e32c7780
commit
eb54488f64
1 changed files with 21 additions and 0 deletions
21
c/l7.c
Normal file
21
c/l7.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
int main() {
|
||||
int pol;
|
||||
printf("Enter number: ");
|
||||
if (scanf("%d", &pol) != 1);
|
||||
|
||||
char st[100] = "";
|
||||
int x = 0;
|
||||
|
||||
if (pol >= 100) pol = 99;
|
||||
|
||||
while(x < pol) {
|
||||
int len = strlen(st);
|
||||
st[len] = '*';
|
||||
st[len + 1] = '\0';
|
||||
x++;
|
||||
printf("%s\n", st);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue