运行程序时我一无所获.只是给了我exe应用程序,就这样.我该如何修复它
I get nothing when I run the program. Just gives me my exe aplication and thats it. How Do I fix it?
代码编译良好,没有错误。但当运行一个程序时,它只会给我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()
函数中编写一些代码,以进行您想要的计算。
相关文章:
- 试图在visual studio上用C++创建一个桌面应用程序
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 在C应用程序中运行C++(带有STL)函数
- 使用VerQueryValue检索应用程序的文件描述
- Qt C++静态thread_local QNetworkAccessManager是线程应用程序的好选择吗
- 使用调试/崩溃报告将应用程序部署到客户端
- C++控制台应用程序阻止退出
- 码头化的C++应用程序是否向后兼容早期的内核版本
- 将应用程序从32位移植到64位时出现问题
- 如果 LibpocoFoundation 与我的小应用程序相关联,readdir 就会挂断电话
- 尝试使用VC++编译器构建Qt应用程序:"type_traits":没有这样的文件或目录
- 为什么C++应用程序不能创建像php,html和css这样的接口?
- 从用户应用程序访问环0模式(以及Borland允许这样做的原因)
- 像 soft32.com 这样的应用程序下载器
- 为什么我的MFC应用程序在打开/运行时也不显示消息就被卸载了
- 是否可以使用 Android NDK 将像 IPOPT 这样的C++求解器集成到 Android 应用程序中?
- Cython代码可以编译成dll吗?这样C++应用程序就可以调用它了
- 致命错误:QtGui/Q应用程序:没有这样的文件或目录|
- 如果没有QDebug消息,Qt应用程序就会崩溃
- 每当WebKit试图加载HTML时,Qt应用程序就会崩溃