مشاهدة النسخة كاملة : البرنامج عبارة عن مستطيل فارغ


متلهف البرمجة
10-06-2006, 12:38 AM
البرنامج عبارة عن مستطيل فارغ المبرمج يقوم بتحديد الطول والأرتفاع ولكن البرامج لايعمل الرجاء أخباري عن الخطاء





#include <stdio.h>
void main()**
int n,m;
char z;
for (;;)
printf("enter the ligth :");

scanf("%d",&n);
printf("enter the width:");
scanf("%d\n%c",&m,&z);
for(int i=1,i<=n;i++)**
for(intj=1;j<=m;j++)
if(i==1)||(i==n))printf("%C",z);
else
if((j== 1)||(j==m)) printf("%C",z);
elss
printf("");
printf("\n");
}}}


?"

نبراس cs
20-07-2006, 10:20 PM
اخي العزيز انا خلفيتي في السي ضعيفه ولكن حولت اوامر الإدخال والطباعه للغه السي بلص بلص

عموماُ كان التعديل فقط في طباعة المسافه

ارجو ان يكون الكود مفهوماً


#include <stdio.h>
#include<iostream>
using namespace std;
void main()
**
int n,m;
char z;
//for (;
//printf("enter the ligth :");
cout<<"enter the higth :"<<endl;
//scanf("%d",&n);
cin>>n;
//printf("enter the width:");
cout<<"enter the width:"<<endl;
//scanf("%d\n%c",&m,&z);
cin>>m>>z;// to enter the width and the spical character..
for(int i=1;i<=n;i++)//for hight
**
for(int j=1;j<=m;j++)// for width
if((i==1)||(i==n))
//printf("%C",z);
cout<<z;
else
if((j== 1)||(j==m))
// printf("%C",z);
cout<<z;
else
//printf("");
cout<<" ";
//printf("\n");
cout<<endl;

}

}// end of main