Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int n;
- scanf("%d", &n);
- if(n < 5) {
- printf("Nevaliden vlez");
- }
- if(n % 2 == 0) {
- printf("Nevaliden vlez");
- }
- for(int i = 1; i <= n; i++) {
- if(i == 1 || i == n) {
- for(int j = 1; j <= n; j++) {
- printf("*");
- }
- printf("\n");
- }
- else {
- for(int j = 1; j <= n; j++) {
- if(j == i || j == n - i + 1) {
- printf("*");
- }
- else {
- printf(" ");
- }
- }
- printf("\n");
- }
- }
- return 0;
- }
- /*
- 9
- *********
- * *
- * *
- * *
- *
- * *
- * *
- * *
- *********
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement