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:

  1. study enginering till sot jor...
    lolzzz

    ReplyDelete
  2. Too stressed up...

    ReplyDelete
  3. 每一科都不是人读的 = =

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

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

    ReplyDelete