This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| void get_coins(int a) { | |
| int quarters = a / 25; a %= 25; | |
| int dimes = a / 10; a %= 10; | |
| int nickles = a / 5; a %= 5; | |
| int pennies = a; | |
| printf( " quarters: %d\n dimes: %d\n nickles: %d\n pennies: %d\n" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function classify(str) | |
| if tonumber(str) == nil then | |
| return str | |
| else | |
| return tonumber(str) | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Prelude hiding (lex) | |
| import Data.Char | |
| import Data.Foldable (sequenceA_) | |
| import Control.Monad.State | |
| data Token = Num Integer | |
| | Op Char deriving (Show, Eq) |
OlderNewer