السلام عليكم ..
اليوم مع مربع مرسوم بالاسكي .. مفيد لاضافته لبعض البرامج مثلا في قوائم البدايه للبرنامج وما الى ذلك ...
كود:
#include <stdio.h> /*programmed by : CPU LinuxAC.ORG */ main() { int width,length; printf("Enter the Width : "); scanf("%d", &width); printf("Enter the Length : "); scanf("%d", &length); up_sq(width); center(length,width); down(width); getch(); } /*the upper of the sqare*/ up_sq(int width){ int i; printf("%c", 201); for ( i=0 ; i < width -2 ; i++ ) { printf("%c", 205); } printf("%c\n", 187); } center(int length ,int width) { int i,c, tmp; char *sp=" "; tmp = width -2; for ( c=0 ; c < length ; c++) { printf("%c", 186); i=tmp; while (i) { printf("%s", sp); i--; } printf("%c\n", 186); } } down(int width) { int i; printf("%c",200); for ( i=0 ; i<width -2 ; i++) printf("%c", 205); printf("%c\n", 188); }
تحياتي
تعليق