图形画反了,有啥问题吗?

#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include "graphics.h"
#include "genlib.h"
#include "conio.h"

#include <windows.h>
#include <olectl.h>
#include <stdio.h>
#include <mmsystem.h>
#include <wingdi.h>
#include <ole2.h>
#include <ocidl.h>
#include <winuser.h>

#define houseHeight         3.0
#define houseWidth          2.0
#define atticHeight         1.0
#define Height              0.3
#define Width               0.4




void DrawHouse(double x, double y);
void DrawOutline(double x, double y);
void DrawBox(double x, double y, double width, double height);
void DrawGrid(double x, double y, double width, double height,
              int columns, int rows);
void Drawdoor(double x, double y, double n);              
void DrawTriangle(double x, double y, double base, double height);
void Main()
{
    double cx, cy;

    InitGraphics();
    cx = GetWindowWidth() / 2;
    cy = GetWindowHeight() / 2;
    DrawHouse(cx - 2*houseWidth,
              cy - houseHeight);
}

void DrawHouse(double x, double y){
    DrawGrid( x, y, houseWidth, houseHeight, 4.0, 2.0);
    DrawTriangle( x,  y, houseWidth, atticHeight);
    DrawTriangle( x+3*houseWidth,  y, houseWidth, atticHeight);
    double s=x+houseWidth;
    Drawdoor( s, y, Width, Height, 6);
}










void Drawdoor(double x, double y,double width, double height, double n){
    int i;
    for(i=1;i<=n;i++){
        DrawBox(x, y, width, height);
        x=x+2*Width;
    }
    
}
void DrawGrid(double x, double y, double width, double height,
              int columns, int rows)
{
    int i, j;

    for (i = 0; i < columns; i++) {
        for (j = 0; j < rows; j++) {
            DrawBox(x + i * width, y + j * height,
                    width, height);
        }
    }
}
void DrawBox(double x, double y, double width, double height)
{
    MovePen(x, y);
    DrawLine(0, height);
    DrawLine(width, 0);
    DrawLine(0, -height);
    DrawLine(-width, 0);
}
void DrawTriangle(double x, double y, double base, double height)
{
    MovePen(x, y);
    DrawLine(base, 0);
    DrawLine(-base / 2, height);
    DrawLine(-base / 2, -height);
}

我的图

img


原图

https://img-mid.csdnimg.cn/release/static/image/mid/ask/923198070156127.png "#left")
img

https://img-mid.csdnimg.cn/release/static/image/mid/ask/600467070156150.png "#left")

找一下函数Drawdoor声明的地方,看看声明的时候是几个参数
void Drawdoor(double x, double y, double n);
你声明的时候3个参数,实现的时候5个参数,问题就在这里了

给的代码不全,无法判断

void Drawdoor(double x, double y,double width, double height, double n)的声明和定义的地方参数个数可能不一样。

1、 DrawHouse函数里面参数定义不对,houseWidth、houseHeight、atticHeight、Width, Height这些变量没有从外部传入函数,函数内部也没有定义。除非你声明为了全局变量。
2、Drawdoor函数传入正确,但书写错误,第二个width首字母写成大写了,应该与形参一致,为小写