就是Chapter1的習題1.26
怎麼樣都會跑錯
知道的人能幫我debug一下嗎,謝啦^^
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
int main()
{
int a, b, c, large, small;
cout << "Please type in 3 different numbers\n";
cin >> a >> b >> c;
large=b;
small=a;
if (a>b)
large=a;
small=b;
if (c<sl)
small=c;
if (c>le)
large=c;
cout << "Sum is " << a+b+c << endl;
cout << "Mean = " << (a+b+c)/3 << endl;
cout << "Product is " << a*b*c << endl;
cout << "Largest is " << large << endl;
cout << "Smallest is " << small << endl;
return 0;
}
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.167.160.47