相关疑难解决方法(0)


What is the proper declaration of main?

What is the proper signature of the main function in C++? What is the correct return type, and what does it mean to return a value from main? What are the allowed parameter types, and what are their meanings?

这是系统特定的吗?这些规则会随着时间而改变吗?如果我违反它们会发生什么?

c++ program-entry-point c++-faq

144
推荐指数
2
解决办法
9万
查看次数

为什么我们从main()返回时遵循相反的约定?

我已经完成了这个和这个,

但我在这里问的问题是为什么被0认为是Success?

我们总是联系0在一起false,不是吗?

c c++ return-value

4
推荐指数
2
解决办法
347
查看次数

比较整数C++

嘿所以我本周刚开始学习基本的c ++,我有一个问题说:

编写一个程序来比较3个整数并打印最大的,程序应该只使用2个IF语句.

我不知道如何做到这一点所以任何帮助将不胜感激

到目前为止我有这个:

#include <iostream>

using namespace std;

void main()
{
int a, b, c;

cout << "Please enter three integers: ";
cin >> a >> b >> c;

if ( a > b && a > c) 
    cout << a;
else if ( b > c && b > a)
    cout << b;
else if (c > a && c > b)
    cout << b;

system("PAUSE");

}
Run Code Online (Sandbox Code Playgroud)

c++

2
推荐指数
2
解决办法
3万
查看次数