Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main ()
- {
- int x, y, z;
- printf("Digite a altura do losango: ");
- scanf("%d",&x);
- if (x&1){
- for (z=0;z<x;z++){
- for(y=0;y<x;y++){
- if(z+y==x/2||z+y==x/2+x-1||==z-1)
- putchar(' ');
- else putchar ('*');
- }
- putchar('\n');
- }
- }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement