/** * @title: hw5.cpp * @date: 2004.11.23 - 21:44 * @author: vinnie * @source for hw5.exe */ #include #include #include #include #include void main( ) { long double lRes; int iSec; char strSec[10]; char c; // code system("color 1f"); // menu' label MYMENU: // begin // reset vars iSec = 0; lRes = 0L; memset( strSec, '\0', 10); // print intro & menu system("cls"); printf("\t\t SLCC - CS 2310-01 - Fall '04 - HW5\n"); printf("\n Number of different messages with 3 signals,"); printf("\n transmitted in n microseconds.\n"); printf("\n Please input how many microseconds : "); gets( strSec); iSec = atoi( strSec); ////////////////////////////////////////////////////////////// lRes = pow( -1, iSec) / 3 + pow( 2, iSec) * 2 / 3; printf("\n In %d microseconds may be transmitted\ \n %Le different messages.\n", iSec, lRes); ////////////////////////////////////////////////////////////// // ask for an other trip printf("\n Another one [Y/y/N/n]? "); while ( !kbhit() ); c = getchar( ); if ( c == 'Y' || c == 'y' ) goto MYMENU; ////////////////////////////////////////////////////////////// printf("\n Thanks for using HW5\n"); printf(" Vincenzo Maggio Code - released under GPL\n"); system("color 0f"); }