//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;
}
}
它在撒谎……我没有遗漏任何分号。我已经在程序的这一点上停留了一段时间,我似乎错过了一些愚蠢的东西。我得到这个错误的唯一一次是我缺少分号并且我已经彻底检查了我的程序多次......谢谢!