我一直盯着这个约一个小时,老实说我不知道我错过了什么.
#include <iostream>
using namespace std;
void callChain();
double chain(int, int &, int &);
int main()
{
callChain();
}
void callChain() {
int totalInches = 53;
int feet;
int inches;
cout << "\nTesting chain for 53 inches: \nExpected result: 15.46 feet: 4 inches: 5" << endl;
cout << "Actual result: " << chain(totalInches, feet, inches) << " feet: " << feet << " inches: " << inches << endl;
}
double chain(int totalInches, int &feet, int &inches) {
feet = …Run Code Online (Sandbox Code Playgroud) c++ ×1