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
| movies = {'red' => 3} | |
| puts "Hey write add" | |
| choice = gets.chomp | |
| case choice | |
| when "add" | |
| puts "What movie?" | |
| title = gets.chomp | |
| puts "What is the rating" | |
| rating = gets.chomp |
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
| cal,a,b,d = 0,100,100,[] | |
| while a < 1000 do | |
| while b < 1000 do | |
| c = a * b | |
| if c.to_s == c.to_s.reverse | |
| d.push(c) | |
| end | |
| b = b + 1 | |
| 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
| a,b,c = 3,4,5 | |
| while a < 1001 do | |
| while b < 1001 do | |
| while c*c < (a*a + b*b +1) do | |
| if a + b + c == 1000 | |
| if a*a + b*b == c*c | |
| x = a * b * c | |
| puts x | |
| 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
| a= 2mn; b= m^2 -n^2; c= m^2 + n^2; | |
| a + b + c = 1000; | |
| 2mn + (m^2 -n^2) + (m^2 + n^2) = 1000; | |
| 2mn + 2m^2 = 1000; | |
| 2m(m+n) = 1000; | |
| m(m+n) = 500; | |
| m>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
| puts "You see Grandma, what do you say?" | |
| stop1,stop2 = false,false | |
| while stop1 == false do | |
| input = gets.chomp | |
| if input != input.upcase | |
| puts 'HUH? SPEAK UP SONNY!' | |
| else | |
| puts 'NO, NOT SINCE 1938!' | |
| convo = [] | |
| while stop2 == false do |
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
| namespace ConsoleApplication12 | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| long num = 600851475143; | |
| double limit = Math.Sqrt(num); | |
| int limit2 = (int) limit; |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApplication13 | |
| { | |
| class Program | |
| { |
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
| cal,a,b,d = 0,100,100,[] | |
| while a < 1000 do | |
| while b < 1000 do | |
| c = a * b | |
| if c.to_s == c.to_s.reverse | |
| d.push(c) | |
| end | |
| b = b + 1 | |
| end | |
| a,b = a + 1, 100 |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace ConsoleApplication13 | |
| { | |
| class Program | |
| { |
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
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Diagnostics; | |
| namespace ConsoleApplication14 | |
| { | |
| class Program |