/******************************************************************/ /* Assistant/2 copyright (c) 1999 Hinnerk Becker */ /* Macro Example Code */ /******************************************************************/ /******************************************************************/ /* NOTE: Read the text from STDIN. */ /* */ /* Write your results to STDOUT. */ /* The macro will wait until this process terminates */ /******************************************************************/ #include #include #include #include int main(int argc, void * arg[]) { float mult,result; char number[50]; if(argc!=2) return 1; mult = atof ( (char *) arg[1]); setmode(fileno(stdin), O_BINARY); setmode(fileno(stdout), O_BINARY); fread(number,1,49,stdin); result = mult * atof(number); printf("%.2f",result); setmode(fileno(stdout), O_TEXT); setmode(fileno(stdin), O_TEXT); return 0; }