Home > Back-end >  Pray god to help
Pray god to help

Time:09-29

Three variables declared in a program, the main function, call to receive the three data input function input from the keyboard, into the three variables, and then call findMax function to find the largest of three number number, finally from the main function will be the largest number of output to the screen,


Help me to change the input function to Pointers to the input, a little bit more simple, I am a c + + beginners
#include
Using namespace STD.

Float input (float s);
A, float findMax (float float b, float c);

The main ()
{
Float a, b, c, Max.
Cout<& lt;" Enter data into three "& lt; A=input (a);
B=input (b);
C=input (c);
Max=findMax (a, b, c);
Cout<& lt;" The maximum value of the three Numbers is: "& lt; }

Float input (float s)
{
Cin> s;
return s;
}

A, float findMax (float float b, float c)
{
Float Max;
Max=a;
If (b> Max)
Max=b;
If (c> Max)
Max=c;
The return of Max;
}

CodePudding user response:

Not sure you mean
Float input (float & amp; S)
{
The scanf (" % f \ n ", & amp; S)
return s;
}
  • Related