gpt4 book ai didi

c - 错误 C2143 : syntax error : missing ';' before ')'

转载 作者:太空宇宙 更新时间:2023-11-04 00:15:29 24 4
gpt4 key购买 nike

<分区>

//Program Written By: Andre Chitsaz-zadeh
//Program Written On: 10/7/12
//Program calculates book cost for multiple book orders.
//Program written using multiple functions.

#include <stdio.h>
#define SIZE 5

void inputData();
void processingData(int costs[]);
int costs[5];

int main ()
{
inputData();
processingData(costs);
}

void inputData()
{
int i = 0;
printf( "\nPlease enter five products costs.\n" );
while(i < 5)
{
scanf("%d", &costs[i]);
i = i + 1;
}
printf("stuff");
for (i = 0, i < 5, i++)
printf("%d\n", costs[i]);
}

void processingData(int costs[])
{
int i;
for (i = 0; i < 4; ++i)
{
int j, min, temp;
min = i;
for (j = i+1; j < 5; ++j)
{
if (costs[j] < costs[min])
min = j;
}

temp = costs[i];
costs[i] = costs[min];
costs[min] = temp;
}
}

这是在撒谎……我没有漏掉任何分号。我在程序的这一点上被困了一段时间,似乎我错过了一些愚蠢的事情。我遇到此错误的唯一一次是我缺少分号并且我已经多次彻底检查我的程序...谢谢!

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com