Friday 3 April 2009

What's Engineering?

#include 〈stdio.h〉
#include 〈stdlib.h〉
#define NORMAL 10
#define HARDER NORMAL*NORMAL
#define PASS 50

int study(int);

int main(){
int counter=0;
 int time_to_study, result;

time_to_study=study(NORMAL);

do{
time_to_study+=study(HARDER);
counter+=1;
  result=(rand() % 50)+1;
}while(result!=PASS);

printf("Level of difficulty for Engineering course: %d\n", counter);
 printf("Total study time needed: %d hours.\n", time_to_study);

return 0;
}


int study(int effort){
int i;
for(i=0;i〈effort;i++);

 return i;
}

9 comments:

Unknown said...

study enginering till sot jor...
lolzzz

G said...

haiz...

Anonymous said...

zha dao

G said...

zha your head

Anonymous said...

Too stressed up...

sheng said...

每一科都不是人读的 = =

G said...

lol

Ronald said...

using C# programming to interpret what's engineering...
great...

G said...

it's only C actually, I not even know how to implement correctly in C++, don't say bout C#