というものなんだが、それ以外のexitでの終了ができないから助けを要請…
自分で書いたものは
#include <stdio.h>
#include <stdlib.h>
#include <eggx.h>
main() {
int quwstion;//1,0の読み込み
int win;
int height;//縦 間隔
int widch;//横 間隔
int n = 1;//色番号の変数
double x ,y;//線の長さ、太さ
printf("Please input 1 or 2.\n");//ユーザー入力
scanf("%d", &quwstion);
if (quwstion != 1 && quwstion != 2)
break;
win=gopen(400,400);//窓表示
winname(win, "sample 1");//窓の名前
x=10.0;//xの初期化
else if (quwstion == 1) {//1:四角を描くとき
for (widch = 0; widch < 38; widch++) {
x=widch*15.0 + 10.0;//線と線の幅を指定
for(height=0; height<38; height++ ) {
newpen(win, n); // 描画する色を設定
y=height*15.0 + 10.0;//線と線の幅を指定
fillrect(win, x, y, 5.0, 5.0);//線を塗る
n++;//カウントアップ
if (n > 15)//黒の線を描かない
n = 1;
}
}
}
else {//2:円を描くとき
for (widch = 0; widch < 38; widch++) {
x=widch*15.0 + 10.0;//線と線の幅を指定
for(height=0; height<38; height++ ) {
newpen(win, n); // 描画する色を設定
y=height*15.0 + 10.0;//線と線の幅を指定
fillarc(win, x, y, 5.0, 5.0, 0.0, 360.0, 1);//線を塗る
n++;//カウントアップ
if (n > 15)//黒の線を描かない
n = 1;
}
}
}
ggetch();
gclose(win);
exit(0);
}