#include <stdio.h>
int f(int a, int b, int c);
int main() {
int a = 2, b = 3, c = 1;
c = f(a+b, a+c, b+c);
printf("a=%d b=%d c=%d\n", a, b, c);
b = f(a, b, c);
printf("a=%d b=%d c=%d\n", a, b, c);
a = f( a, b, f(c, b, a) );
printf("a=%d b=%d c=%d\n", a, b, c);
system("PAUSE");
return 0;
}
int f(int a, int b, int c) {
int sum;
sum = a + b + c;
if (sum < a*B)/>
return a + b;
if (sum <= 2*a*B)/>
return b + c;
return a + c;
}
Specifically I do not know where to start. Obviously variables are declared here:
int f(int a, int b, int c)
and here:
int a = 2, b = 3, c = 1;
but I do not know how to handle
c = f(a+b, a+c, b+c);
b = f(a, b, c);
a = f( a, b, f(c, b, a) );
Also I am at a complete loss when it comes to
int f(int a, int b, int c)
and return a + c;
I know I am missing the background for functions but I just cannot find suitable material in his notes.
I will even provide the link to all of his lecture notes, maybe it is just buried somewhere in there. http://www.cs.ucf.ed...s/indexF08.html
I apologize for all the questions, but I have hit a road block, and I need someone to point me to or provide some sort of study material, or examples.
This post has been edited by bradleycmetz: 15 October 2012 - 08:05 AM

New Topic/Question
Reply



MultiQuote





|