#晴雨夏雪 2022-03-20 18:14 采纳率: 100%
浏览 35
已结题

c语言初学者的基础改错题

#include <stdio.h>
int main( )
{
int product(int a, int b );
int x, y, p;
/found/
scanf("%x%y", &x, &y);
p = product(x, y);
printf("The product is :%d\n", p);
}
int product(int a, int b )
{
int c ;
/found/
c= a*b;
/found/

}

  • 写回答

3条回答 默认 最新

  • 关注

    你题目的解答代码如下:

    #include <stdio.h>
    int main()
    {
        int product(int a, int b);
        int x, y, p;
        scanf("%d%d", &x, &y); //改成%d
        p = product(x, y);
        printf("The product is :%d\n", p);
    }
    int product(int a, int b)
    {
        int c;
        c = a * b;
        return c; //加上return c;
    }
    

    如有帮助,请点击我的回答下方的【采纳该答案】按钮帮忙采纳下,谢谢!

    img

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

问题事件

  • 系统已结题 3月28日
  • 已采纳回答 3月20日
  • 创建了问题 3月20日