shahinshyd
شنبه 15 خرداد 1389, 18:04 عصر
باعرض سلام من یک برنامه ایجاد چند تا شکل با قابلیت رنگ کردن اونا رو نوشتم ولی این ارور هاش منو بیچاره کردن اگه میشه کمکم کنید
#include<graphics.h>
#include<conio.h>
#include<iostream.h>
void cirrcle(int);
void linne(int)
void recct(int);
void oppen();
void dellet();
int main()
{
char ch;
int x1,y1,x2,y2,d;
ifstream fin("save.txt");
ofstream fout("save.txt");
int dg=DETECT,gm=0;
initgraph(&gd,&gm,"");
cout<<"press the bottons bellow and the information require"<<endl<<"q:quit, c:circle, r:rectange, l:line, s:save, d:delet,o:open";
do
{
cin>>ch;
switch(ch)
{
case 'r': recct(0); break;
case 'c': cirrcle(0); break;
.
.
.
case 'l': linne(0); break;
case 'o': oppen(); break;
case 'd': dellet(); break;
}
}while(ch!='q');
getch();
closegraph();
return 0;
}
void recct(int a)
{
(a)?fin>>x1>>y1>>x2>>y2>>col; :cin>>x1>>y1>>x2>>y2>>col;
fout<<'r'<<' '<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<endl;
setcolor(col);
rectangle(x1,y1,x2,y2);
}
void cirrcle(int a)
{
(a)?fin>>x1>>y1>>d>>col;:cin>>x1>>y1>>d>>col;
fout<<'c'<<' '<<x1<<' '<<' '<<y1<<' '<<d<<endl;
setcolor(col);
circle(x1,y1,d);
}
void linne(int a)
{
(a)?fin>>x1>>y1>>x2>>y2>>col;:cin>>x1>>y1>>x2>>y2>>col;
fout<<'l'<<' '<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<endl;
setcolor(col);
line(x1,y1,x2,y2);
}
void oppen()
{
while(!eof())
{
fin>>ch;
switch(ch)
{
case 'r': recct(1); break;
case 'c': cirrcle(1); break;
.
.
.
case 'l': linne(1); break;
case 'o': oppen(1); break;
case 'd': dellet(1); break;
}
}
}
#include<graphics.h>
#include<conio.h>
#include<iostream.h>
void cirrcle(int);
void linne(int)
void recct(int);
void oppen();
void dellet();
int main()
{
char ch;
int x1,y1,x2,y2,d;
ifstream fin("save.txt");
ofstream fout("save.txt");
int dg=DETECT,gm=0;
initgraph(&gd,&gm,"");
cout<<"press the bottons bellow and the information require"<<endl<<"q:quit, c:circle, r:rectange, l:line, s:save, d:delet,o:open";
do
{
cin>>ch;
switch(ch)
{
case 'r': recct(0); break;
case 'c': cirrcle(0); break;
.
.
.
case 'l': linne(0); break;
case 'o': oppen(); break;
case 'd': dellet(); break;
}
}while(ch!='q');
getch();
closegraph();
return 0;
}
void recct(int a)
{
(a)?fin>>x1>>y1>>x2>>y2>>col; :cin>>x1>>y1>>x2>>y2>>col;
fout<<'r'<<' '<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<endl;
setcolor(col);
rectangle(x1,y1,x2,y2);
}
void cirrcle(int a)
{
(a)?fin>>x1>>y1>>d>>col;:cin>>x1>>y1>>d>>col;
fout<<'c'<<' '<<x1<<' '<<' '<<y1<<' '<<d<<endl;
setcolor(col);
circle(x1,y1,d);
}
void linne(int a)
{
(a)?fin>>x1>>y1>>x2>>y2>>col;:cin>>x1>>y1>>x2>>y2>>col;
fout<<'l'<<' '<<x1<<' '<<y1<<' '<<x2<<' '<<y2<<endl;
setcolor(col);
line(x1,y1,x2,y2);
}
void oppen()
{
while(!eof())
{
fin>>ch;
switch(ch)
{
case 'r': recct(1); break;
case 'c': cirrcle(1); break;
.
.
.
case 'l': linne(1); break;
case 'o': oppen(1); break;
case 'd': dellet(1); break;
}
}
}