#include<stdio.h>
#include<conio.h>
#include<string.h>
// Program za crtanje romboida od brojeva
/*
1 2
1 2
1 2
1 2
1 2
3 4
3 4
3 4
3 4
3 4
*/
void gornjiTrougao(){
for(int i=5;i>=1;i--){
for (int j=1;j<i+1;j++){
printf(" ");
}
printf("1");
for(int k=0;k<=5-i;k++){
printf(" ");
}
for(int k=1;k<=5-i;k++){
printf(" ");
}
printf("2\n");
}
}
void donjiTrougao(){
int s,j,k,l;
for ( s=1;s<=5;s++){
for ( j=5;j>5-s;j--){
printf(" ");
}
printf("3");
for( k=0;k<=5-s;k++){
printf(" ");
}
for( l=1;l<=5-s;l++){
printf(" ");
}
printf("4\n");
}
}
main (){
gornjiTrougao();
donjiTrougao();
getch();
}
#include<conio.h>
#include<string.h>
// Program za crtanje romboida od brojeva
/*
1 2
1 2
1 2
1 2
1 2
3 4
3 4
3 4
3 4
3 4
*/
void gornjiTrougao(){
for(int i=5;i>=1;i--){
for (int j=1;j<i+1;j++){
printf(" ");
}
printf("1");
for(int k=0;k<=5-i;k++){
printf(" ");
}
for(int k=1;k<=5-i;k++){
printf(" ");
}
printf("2\n");
}
}
void donjiTrougao(){
int s,j,k,l;
for ( s=1;s<=5;s++){
for ( j=5;j>5-s;j--){
printf(" ");
}
printf("3");
for( k=0;k<=5-s;k++){
printf(" ");
}
for( l=1;l<=5-s;l++){
printf(" ");
}
printf("4\n");
}
}
main (){
gornjiTrougao();
donjiTrougao();
getch();
}
No comments:
Post a Comment