<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. Pseudo code
  3. obtain bet 1 number and amount
  4. obtain bet 2 number and amount
  5. obtain bet 3 number and amount
  6. obtain bet 4 number and amount
  7.  
  8. obatin random numbers generated
  9.  
  10.  
  11. IF bet number 1 is equal to the random number
  12.    THEN
  13. times bet amount 1 by 35 and add bet amount
  14. 35 * bet amount 1 + bet amount 1
  15.    THEN
  16. display bet number, bet amount, winning number and payout value
  17.    ELSE IF
  18. bet number 1 is NOT equal to the random number
  19.    THEN
  20. display bet number, bet amount, winning number and loss
  21.    END IF
  22.  
  23.  
  24. IF bet number 2 is equal to the random number
  25.    THEN
  26. times bet amount 2 by 35 and add bet amount 2
  27. 35*bet amount 2 + bet amount 2
  28.    THEN
  29. display bet number, bet amount, winning number and payout value
  30.    ELSE IF
  31. bet number 2 is NOT equal to the random number
  32.    THEN
  33. display bet number, bet amount, winning number and loss
  34.    END IF
  35.  
  36.  
  37.  
  38. IF bet number 3 is equal to the random number
  39.    THEN
  40. times bet amount 3 by 35 and add bet amount
  41. 3 35*bet amount 3 + bet amount 3
  42.    THEN
  43. display bet number, bet amount, winning number and payout value
  44.    ELSE IF
  45. bet number 3 is NOT equal to the random number
  46.    THEN
  47. display bet number, bet amount, winning number and loss
  48.    END IF
  49.  
  50.  
  51. IF bet number 4 is equal to the random number
  52.    THEN
  53. times bet amount 4 by 35 and add bet amount
  54. 4 35*bet amount 4+bet amount 4
  55.    THEN
  56. display bet number, bet amount, winning number and payout value
  57.    ELSE IF
  58. bet number 4 is NOT equal to the random number
  59.    THEN
  60. display bet number, bet amount, winning number and loss
  61.    END IF
  62.  
  63.    display player net profit / net loss
  64.  
  65. END */
  66.  
  67. #include <stdio.h>
  68.  
  69.  
  70. int main( void )
  71. {
  72.    
  73. int number1, bet1, number2, bet2, number3, bet3, number4, bet4, winnings1, winnings2, winnings3, winnings4, loss1, loss2, loss3, loss4, total1, total2, total3, total4, total5,total6, total7, total8, total9,total10, total11, total12, total13, total14, total15, total16 ; ;
  74.    scanf ("%d %d %d %d %d %d %d %d" , &number1, &bet1, &number2, &bet2, &number3, &bet3, &number4, &bet4) ;
  75.  
  76.   winnings1 = bet1 * 35 + bet1 ;
  77.   winnings2 = bet2 * 35 + bet2 ;
  78.   winnings1 = bet3 * 35 + bet3 ;
  79.   winnings1 = bet4 * 35 + bet4 ;
  80.  
  81.   loss1 = 0 - bet1 ;
  82.   loss2 = 0 - bet2 ;
  83.   loss3 = 0 - bet3 ;
  84.   loss4 = 0 - bet4 ;
  85.  
  86.   total1 = loss1 + loss2 + loss3 + loss4 ;
  87.   total2 = winnings1 + loss2 + loss3 + loss4 ;
  88.   total3 = loss1 + winnings2 + loss3 + loss4 ;
  89.   total4 = loss1 + loss2 + winnings3 + loss4 ;
  90.   total5 = loss1 + loss2 + loss3 + winnings4 ;
  91.   total6 = winnings1 + winnings2 + loss3 + loss4 ;
  92.   total7 = winnings1 + loss2 + winnings3 + loss4 ;
  93.   total8 = winnings1 + loss2 + loss3 + winnings4 ;
  94.   total9 = loss1 + winnings2 + winnings3 + loss4 ;
  95.   total10 = loss1 + winnings2 + loss3 + winnings4 ;
  96.   total11 = loss1 + loss2 + winnings3 + winnings4 ;
  97.   total12 = winnings1 + winnings2 + winnings3 + loss4 ;
  98.   total13 = winnings1 + winnings2 + loss3 + winnings4 ;
  99.   total14 = winnings1 + loss2 + winnings3 + winnings4 ;
  100.   total15 = loss1 + winnings2 + winnings3 + winnings4 ;
  101.   total16 = winnings1 + winnings2 + winnings3 + winnings4 ;
  102.  
  103.  
  104. int RNum;
  105.    srand(time(NULL));
  106.    RNum = rand();
  107.    RNum = RNum %38;
  108.    
  109.    if ( number1 >37 )
  110.       printf ( "Please enter a valid number!\n");
  111.    else if ( number2 >37 )
  112.       printf ( "Please enter a valid number!\n");
  113.    else if ( number3 >37 )
  114.       printf ( "Please enter a valid number!\n");
  115.    else if ( number4 >37 )
  116.       printf ( "Please enter a valid number!\n");
  117.      
  118.    if ( bet1 <1 )
  119.       printf ( "Please place a bet!\n" );
  120.    else if ( bet2 <1 )
  121.       printf ( "Please place a bet!\n" );
  122.    else if ( bet3 <1 )
  123.       printf ( "Please place a bet!\n" );
  124.    else if ( bet4 <1 )
  125.       printf ( "Please place a bet!\n" );
  126.      
  127.  else {   
  128.    
  129.    if  ( RNum == 37 )
  130.    printf ( "Winning number: 00");
  131.    else printf ( "Winning number %d\n", RNum);
  132.    
  133.    
  134.  if ( number1 == RNum )
  135.     printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d" , number1, bet1, RNum, winnings1);
  136.    else if ( number1 != RNum )
  137.      printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number1, bet1, RNum, loss1 );
  138.  
  139.    
  140.    if ( number2 == RNum )
  141.       printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number2, bet2, RNum, winnings2);
  142.    else if ( number2 != RNum )
  143.       printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number2, bet2, RNum, loss2 );
  144.      
  145.    
  146.    if ( number3 == RNum )
  147.       printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number3, bet3, RNum, winnings3);
  148.    else if ( number3 != RNum )
  149.       printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number3, bet3, RNum, loss3 );
  150.    
  151.    if ( number4 == RNum )
  152.       printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number4, bet4, RNum, winnings4);
  153.    else if ( number4 != RNum )
  154.       printf ( " Your number: %d , Your bet: %d , Winning number: %d , Your winnings %d\n" , number4, bet4, RNum, loss4 );
  155.      
  156.    if ( number1 != RNum  && number2 != RNum && number3 != RNum && number4 != RNum)
  157.       printf ( "Total profit: %d" , total1 );
  158.    else if ( number1 == RNum  && number2 != RNum && number3 != RNum && number4 != RNum)
  159.       printf ( "Total profit: %d" , total2 );
  160.    else if ( number1 != RNum  && number2 == RNum && number3 != RNum && number4 != RNum)
  161.       printf ( "Total profit: %d" , total3 );
  162.    else if ( number1 != RNum  && number2 != RNum && number3 == RNum && number4 != RNum)
  163.       printf ( "Total profit: %d" , total4 );
  164.    else if ( number1 != RNum  && number2 != RNum && number3 != RNum && number4 == RNum)
  165.       printf ( "Total profit: %d" , total5 );
  166.    else if ( number1 == RNum  && number2 == RNum && number3 != RNum && number4 != RNum)
  167.       printf ( "Total profit: %d" , total6 );
  168.    else if ( number1 == RNum  && number2 != RNum && number3 == RNum && number4 != RNum)
  169.       printf ( "Total profit: %d" , total7 );
  170.    else if ( number1 == RNum  && number2 != RNum && number3 != RNum && number4 == RNum)
  171.       printf ( "Total profit: %d" , total8 );
  172.    else if ( number1 != RNum  && number2 == RNum && number3 == RNum && number4 != RNum)
  173.       printf ( "Total profit: %d" , total9 );
  174.    else if ( number1 == RNum  && number2 == RNum && number3 != RNum && number4 != RNum)
  175.       printf ( "Total profit: %d" , total10 );
  176.    else if ( number1 != RNum  && number2 != RNum && number3 == RNum && number4 == RNum)
  177.       printf ( "Total profit: %d" , total11 );
  178.    else if ( number1 == RNum  && number2 == RNum && number3 == RNum && number4 != RNum)
  179.       printf ( "Total profit: %d" , total12 );
  180.    else if ( number1 == RNum  && number2 == RNum && number3 != RNum && number4 == RNum)
  181.       printf ( "Total profit: %d" , total13 );
  182.    else if ( number1 == RNum  && number2 != RNum && number3 == RNum && number4 == RNum)
  183.       printf ( "Total profit: %d" , total14 );
  184.    else if ( number1 != RNum  && number2 == RNum && number3 == RNum && number4 == RNum)
  185.       printf ( "Total profit: %d" , total15 );
  186.    else if ( number1 == RNum  && number2 == RNum && number3 == RNum && number4 == RNum)
  187.       printf ( "Total profit: %d" , total16 );
  188.          
  189.    
  190.    }
  191.    
  192.      
  193.    
  194.    
  195.    
  196.     }