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
| package main | |
| import "fmt" | |
| func main() { | |
| //Enter your code here. Read input from STDIN. Print output to STDOUT | |
| var input int | |
| fmt.Scanf("%d", &input) | |
| for i := 1; i <= 10; i++ { | |
| output := input * i |
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
| package main | |
| import "fmt" | |
| func PrintEvenIndexes(array []byte) { | |
| for i := range array { | |
| if i % 2 == 0 { | |
| fmt.Printf("%s", string(array[i])) | |
| } | |
| } | |
| } |
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
| pidof "$@" | xargs -0 -r kill -SIGTERM |
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
| solveMeFirst a b = a + b | |
| main = do | |
| val1 <- readLn | |
| val2 <- readLn | |
| let sum = solveMeFirst val1 val2 | |
| print sum |
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
| f :: Int -> [Int] -> [Int] | |
| f n arr = concatMap (replicate n) arr | |
| -- This part handles the Input and Output and can be used as it is. Do not modify this part. | |
| main :: IO () | |
| main = getContents >>= | |
| mapM_ print. (\(n:arr) -> f n arr). map read. words |
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
| f :: [Int] -> [Int] | |
| f lst = map ((!!)lst) [1,3..length lst-1] | |
| -- This part deals with the Input and Output and can be used as it is. Do not modify it. | |
| main = do | |
| inputdata <- getContents | |
| mapM_ (putStrLn. show). f. map read. lines $ inputdata |
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
| 3 | |
| 2 | |
| 4 | |
| 6 | |
| 5 | |
| 7 | |
| 8 | |
| 0 | |
| 1 |
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
| #!/bin/bash | |
| echo "Enter number to be converted: " | |
| read no | |
| echo "Converting $no from decimal to binary (base2)" | |
| no=`echo "obase=2;$no" | bc` | |
| echo Binary: $no | |
| echo "Converting binary($no) to decimal" | |
| no=`echo "obase=10;ibase=2;$no" | bc` |
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
| <?php | |
| for ($i = 1; $i < 200; $i++) { | |
| $a = load($i); | |
| echo "You have allocated {$i}M (".memory_get_usage().") memory in this php script\n"; | |
| unset($a); | |
| } | |
| function load($i) |
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
| #!/bin/bash | |
| function usage() | |
| { | |
| printf "Usage:\n\n" | |
| printf "./delete_merged_branches <branch>\n\n" | |
| } | |
| if [ "$1" == "" ]; then | |
| usage |