Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main () {
- int i, j, max=0, min=9999, suma=0, x=0, proizvod=1; // RESET promenlivi
- float y=1.5;
- char c='@';
- scanf("%d", &x);
- for ( i=1 ; i <= x ; i++ ) { // i++, ++i, i+=1, i+=2; //BROI REDICI
- printf ("\n") ; // sluzhi za odenje nadole
- for ( j=1 ; j <= x ; j++ ){ // vnatreshen // KOLONI(VERTIKALI)
- //if( i == 1 || j==1 || i == x || j==x ) {
- if( i == 1 || i == x ) {
- printf ("*" ) ;
- }
- else{
- if( i==j ) // i=1 (j:1,2,3,4..10) ; i=2 (j:1,2..10)
- printf ("*" ) ;
- else
- if( i+j == x+1 ) // sporedna dijagonala
- printf ("*" ) ;
- else
- printf (" " ) ;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement