运行程序时我一无所获.只是给了我exe应用程序,就这样.我该如何修复它

I get nothing when I run the program. Just gives me my exe aplication and thats it. How Do I fix it?

本文关键字:就这样 应用程序 何修复 exe 程序 一无所获 运行      更新时间:2024-09-22

代码编译良好,没有错误。但当运行一个程序时,它只会给我exe程序,程序结束时没有输入或输出。我该怎么做?请帮帮我。初级程序员。代码还没有完成,只有输出部分。我的下一步行动是什么。欢迎发表意见。----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------低于的代码

const int MONTH_QUANTITY = 12;
typedef double Rainfalls[MONTH_QUANTITY];
// Function prototypes
double findTotal(Rainfalls, double);
double findMonthlyAverage(Rainfalls, double);
double findHighest(Rainfalls, double);
double findLowest(Rainfalls, double);
void getUserInput(Rainfalls, double);
// Main function
int main(int argc, char** argv) {
Rainfalls monthArray;
void getUserInput(Rainfalls, double);
double findTotal(Rainfalls, double);
int monthlyHighest;
int monthlyLowest;
double monthlyAverage;
return 0;
}
void getUserInput(Rainfalls monthArray, double MonthlyRainfalls)
{
std::cout << "Please enter total rainfalls over a period of 12 monthn";
for(int rainfalls = 0; rainfalls < MONTH_QUANTITY; rainfalls++)
{
std::cout << "Month"<< (rainfalls + 1) << ": ";
std::cin >> monthArray[rainfalls];
while(monthArray[rainfalls] < 0)
{
std::cout << "Error! Negative numbers are not allowed";
std::cout << "Please enter amount of rainfall above or equal to 0n";
std::cin >> monthArray[rainfalls];
}
}
}

double findTotal(Rainfalls totalMonths, double totalRainfalls)
{
double totalRainfall = 0;
for(int i = 0; i < MONTH_QUANTITY; i++)
totalRainfall += totalMonths[i];

return totalRainfall;
}
double findMonthlyAverage(Rainfalls monthlyAverage, double quantity)
{
double average = 0;
for(int rainfall = 0; rainfall < quantity; rainfall++)

average += monthlyAverage[rainfall];

return (average / quantity);
}
int findHighest(Rainfalls array, int max)
{
int highest = array[0];
for(int index = 1; index < max; index++)
{
if(array[index] > highest)
highest = array[index];
}
return highest;
}   

int findLowest(Rainfalls array, int max)
{
int lowest = 0;
for(int index = 1; index < lowest; index++)
{
if(array[index] < lowest)
lowest = array[index];
}
return lowest;
}

main函数中似乎没有任何语句可以做任何事情(除了return 0;(:

int main(int argc, char** argv) {
Rainfalls monthArray;
void getUserInput(Rainfalls, double);
double findTotal(Rainfalls, double);
int monthlyHighest;
int monthlyLowest;
double monthlyAverage;
return 0;
}

它只包含变量和函数的声明。

下一步将在main()函数中编写一些代码,以进行您想要的计算。