######################### 1001 ############## ################
Use 5.010; while (<>) {my @ num = split; say $ num [0] + $ num [1];}
######################### 1048 ############## ################
My $ n = 12; my $ sum = 0; while ($ n --) {chomp (my $ num = <stdin>); $ sum + = $ num ;} printf "/$ %. 2f/N ", $ sum/12;
######################### 1109 ############## ################
Use 5.010; my % hash; while (<stdin>) {last if $ _ eq "/N"; my ($ value, $ key) = split; $ hash {$ key }=$ value;} while (<stdin>) {chomp; exists $ hash {$ _}? Say "$ hash {$ _}": Say "eh ";}
######################### 1151 ############## ################
My $ case = <stdin>; for (1 .. $ case) {chomp (my $ n = <stdin>); Redo if $ n EQ ''; print"/N "If $ _! = 1; for (1 .. $ n) {chomp ($ _ = <stdin>); my @ arr = split; while (@ ARR) {print reverse split '', shift @ arr; print "" If @ arr; # print "/N ";}}
######################### 1240 ############## ##############
Chomp (my $ num = <stdin>); my $ Nums = 1; while ($ num --) {chomp (my $ STR = <stdin> ); printf "string # % d/N", $ Nums ++; my @ arr = Split ("", $ Str); $ STR = shift @ arr; while ($ Str) {$ str eq "Z "? Print "A": Print CHR (ord ($ Str) + 1); $ STR = shift @ arr;} print "/n ";}
######################### 1241 ############## ################
My $ n = 1; while (<stdin>) {My ($ A, $ B, $ c) = split; last if $ A + $ B + $ c = 0; printf "Triangle # % d/N", $ n ++; printf "c = %. 3f ", SQRT ($ A ** 2 + $ B ** 2) If $ c =-1; $ C> $? Printf "B = %. 3f ", SQRT ($ C ** 2-$ A ** 2): Print" impossible. "If $ B =-1; $ C> $ B? Printf "A = %. 3f ", SQRT ($ C ** 2-$ B ** 2): Print" impossible. "If $ A =-1; print"/n ";}
######################### 1608 ############## ################
Use 5.010; while (<>) {My ($ A, $ B, $ R1, $ R2) = split; my $ total_r = $ R1 + $ R2; (say "no") & next if $ total_r> $ A | $ total_r> $ B; SQRT ($ A-$ total_r) ** 2 + ($ B-$ total_r) ** 2) <$ total_r? Say "No": Say "yes ";}
######################### 1808 ############## ################
My $ flag = 0; my $ COUNT = 1; my @ arr; while (<stdin>) {chomp; if ($ _ = 9) {printf "set % d is immediately decodable/N", $ count ++ if $ flag! = 1; $ # arr =-1; $ flag = 0; next;} next if $ flag = 1; push @ arr, $ _; for (my $ I = 0; $ I <=$ # arr-1 & $ flag! = 1; $ I ++) {(printf "set % d is not immediately decodable/N", $ count ++) & ($ flag = 1) if/^ $ arr [$ I]/;}
-------------------------------------- Separate line -----------------------------------------
Notes: 1. The question and code are very simple, so no comments are added to the Code. 2. If the Code has errors or can be improved, please tell me how to improve each other! 3. Sharing is a virtue!