Upgrade to Pro — share decks privately, control downloads, hide ads and more …

ruby_exams

 ruby_exams

Ruby演習問題集

Kuniaki IGARASHI

July 01, 2014
Tweet

More Decks by Kuniaki IGARASHI

Other Decks in Technology

Transcript

  1. ԋश໰୊ "SSBZΦϒδΣΫτͷཁૉ͕ح਺ͷ߲໨Λશͯ଍͢ ίʔυΛॻ͍͍ͯͩ͘͞ɻ ྫ͑͹BSSBZ<    >ͷ৔߹ɺ  

      ͕දࣔ͞ΕΕ͹0,Ͱ͢ɻ ! ώϯτɿح਺͔Ͳ͏͔ௐ΂Δͷ͸'JYOVNPEE ϝιου ͪͳΈʹۮ਺͔ௐ΂Δͷ͸'JYOVNFWFO ϝιουͰ͢ɻ PEE USVF PEE GBMTF 
  2. ԋश໰୊ <\UJUMFB QSJDF^  \UJUMFC QSJDF^  \UJUMFD QSJDF^> !

    ͱ͍͏ΦϒδΣΫτ͔ΒɺҎԼͷΑ͏ͳΦϒδΣΫτΛ࡞Δίʔ υΛॻ͍͍ͯͩ͘͞ɻ ! <\UJUMFB QSJDF TQFDJBM-PXQSJDF^  \UJUMFC QSJDF^  \UJUMFD QSJDF TQFDJBM-PXQSJDF^> 
  3. ԋश໰୊ BMJDF CPC DBSPMͷࢼݧͷ఺਺͕࣍ͷΑ͏ʹ)BTIʹ֨ೲ͞Ε͍ͯ ·͢ɻ BMJDF\FOHMJTI NBUI IJTUPSZ^ CPC\FOHMJTI NBUI

    IJTUPSZ^ DBSPM\FOHMJTI NBUI IJTUPSZ^ ! ֤Պ໨ͷฏۉ఺Λग़ྗ͍ͯͩ͘͠͞ 
  4. ԋश໰୊ "SSBZΦϒδΣΫτͷཁૉ͕ح਺ͷ߲໨Λશͯ଍͢ίʔυΛॻ͍͍ͯͩ͘͞ɻ ྫ͑͹BSSBZ<    >ͷ৔߹ɺ   ͕දࣔ͞ΕΕ͹

    0,Ͱ͢ɻ ώϯτɿح਺͔Ͳ͏͔ௐ΂Δͷ͸'JYOVNPEE ϝιου ͪͳΈʹۮ਺͔ௐ΂Δͷ͸'JYOVNFWFO ϝιουͰ͢ɻ BSSBZ<    > TVN BSSBZFBDIEPcJc TVN JJGJPEE  FOE QTVN ߦͰ͔ͬ͜Α͘ॻ͘͜ͱ΋Ͱ͖·͢ɻ ্ڃऀ޲͚ <    >TFMFDU\cJcJPEE ^JOKFDU  PEE USVF PEE GBMTF 
  5. ԋश໰୊ <\UJUMFB QSJDF^  \UJUMFC QSJDF^  \UJUMFD QSJDF^> ͱ͍͏ΦϒδΣΫτ͔ΒɺҎԼͷΑ͏ͳΦϒδΣΫτΛ࡞ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ

    <\UJUMFB QSJDF TQFDJBM-PXQSJDF^  \UJUMFC QSJDF^  \UJUMFD QSJDF TQFDJBM-PXQSJDF^> JUFNT<\UJUMFB QSJDF^  \UJUMFC QSJDF^  \UJUMFD QSJDF^> JUFNTFBDIEPcJUFNc JUFN<TQFDJBM>-PXQSJDFJGJUFN<QSJDF> FOE QJUFNT <\UJUMFB QSJDF TQFDJBM-PXQSJDF^  \UJUMFC QSJDF^  \UJUMFD QSJDF TQFDJBM-PXQSJDF^> ࣮ߦ݁Ռ 
  6. ԋश໰୊ ͋Δ"SSBZΦϒδΣΫτ͕༩͑ΒΕͨͱ͖ɺ ྫ ͑͹<  > ͦͷதͰҎԼͷ਺ࣈ͕͍ͭ͋͘ Δ͔දࣔ͢ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ BSSBZ< 

    > DPVOU BSSBZFBDIEPcJc DPVOU JGJ FOE QDPVOU BSSBZ<  > QBSSBZDPVOU\cJcJ^ ผղɹDPVOUϝιουʹϒϩοΫΛ౉͢͜ͱͰΧ΢ϯτͰ͖·͢ɻ ϒϩοΫ͸EPFOEͷมΘΓʹ\^Ͱॻ͘͜ͱ΋Ͱ͖·͢ɻ 
  7. ԋश໰୊ )BTIͷ஋ͷதʹͱ͍͏จࣈؚ͕·ΕΔͱ͖ʹɺͦͷ஋Λେจࣈ ʹม׵ͨ͠)BTIΛ࡞ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ ྫ͑͹ɺ \BMJDFZFBI CPCZP MJOEBXPX^ ˢͱ͍͏)BTIΛˣʹͰ͖Ε͹0,Ͱ͢ɻ \BMJDFZFBI CPC:0

    MJOEB808^ I\BMJDFZFBI CPCZP MJOEBXPX^ IFBDIEPcLFZ WBMVFc I<LFZ>WBMVFVQDBTFJGWBMVFd FOE QI \BMJDFZFBI CPC:0 MJOEB808^ 
  8. ԋश໰୊ EFGQSJOU@UFYU I  QVUT5IJTPCKFDUEPFTOPUIBWFUFYULFZVOMFTTI<UFYU> FOE QSJOU@UFYU \UFYUUIF3VCZCPPL^ ग़ྗͳ͠ QSJOU@UFYU

    \GPPCBS^ 5IJTPCKFDUEPFTOPUIBWFUFYULFZ Ҿ਺ʹϋογϡΛड͚औΔϝιουΛॻ͍͍ͯͩ͘͞ɻͦͷϝιουͷதͰɺҾ਺Ͱड͚औͬͨ ϋογϡʹΩʔUFYU͕ͳ͔ͬͨͱ͖ɺ5IJTPCKFDUEPFTOPUIBWFUFYULFZͱग़ ྗ͢ΔίʔυΛॻ͍͍ͯͩ͘͞ɻ ʢྫ͑͹ɺϝιου໊ΛQSJOU@UFYUͱͯ͠ɺϝιουݺͼग़͠ଆ͸ҎԼͷΑ͏ʹͳΓ·͢ɻʣ QSJOU@UFYU \UJUMFzUIF3VCZCPPLz^ 
  9. ԋश໰୊ BMJDF CPC DBSPMͷࢼݧͷ఺਺͕࣍ͷΑ͏ʹ)BTIʹ֨ೲ͞Ε͍ͯ·͢ɻ BMJDF\FOHMJTI NBUI IJTUPSZ^ CPC\FOHMJTI NBUI IJTUPSZ^

    DBSPM\FOHMJTI NBUI IJTUPSZ^ ֤Պ໨ͷฏۉ఺Λग़ྗ͍ͯͩ͘͠͞ BMJDF\FOHMJTI NBUI IJTUPSZ^ CPC\FOHMJTI NBUI IJTUPSZ^ DBSPM\FOHMJTI NBUI IJTUPSZ^ ! QVUTFOHMJTIBWFSBHF  BMJDF<FOHMJTI> CPC<FOHMJTI> DBSPM<FOHMJTI>  QVUTNBUIBWFSBHF  BMJDF<NBUI> CPC<NBUI> DBSPM<NBUI>  QVUTIJTUPSZBWFSBHF  BMJDF<IJTUPSZ> CPC<IJTUPSZ> DBSPM<IJTUPSZ>  
  10. ԋश໰୊ʲ্ڃʳ4ղ ͋ΔςΩετϑΝΠϧ͔ΒɺBͱ͍͏จࣈྻΛؚΉߦͩ ͚Λநग़ͨ͠ผͷςΩετϑΝΠϧΛ࡞͍ͬͯͩ͘͞ɻ ྫɿ BMJDF CPC DBSPM BMJDF DBSPM ϑΝΠϧ͔ΒಡΈࠐΈ

    JODMVEFE<>ग़ྗ༻σʔλΛ֨ೲ͢Δ"SSBZ JO@pMFOBNFJOUYU 'JMFPQFO JO@pMFOBNF S65' EPcJO@pMFc XIJMFUFYUJO@pMFHFUT JODMVEFEUFYUJGUFYUdB FOE FOE ϑΝΠϧ΁ॻ͖ࠐΈ PVU@pMFOBNFPVUUYU 'JMFPQFO PVU@pMFOBNF X65' EPcPVU@pMFc JODMVEFEFBDIEPcJc PVU@pMFQVUTJ FOE FOE ͭͷϑΝΠϧΛPQFO͠·͢ɻ ग़ྗଆ͸X65' ॻ͖ࠐΈ Ͱ͢ɻ ·ͨɺ'JMFPQFOʹϒϩοΫΛ ౉͢ͱϒϩοΫ׬ྃ࣌ʹࣗಈͰ DMPTF͠·͢ 
  11. ԋश໰୊ʲ্ڃʳ4ղ ͋ΔςΩετϑΝΠϧ͔ΒɺBͱ͍͏จࣈྻΛؚΉߦͩ ͚Λநग़ͨ͠ผͷςΩετϑΝΠϧΛ࡞͍ͬͯͩ͘͞ɻ ྫɿ BMJDF CPC DBSPM BMJDF DBSPM JO@pMFOBNFJOUYU

    PVU@pMFOBNFPVUUYU 'JMFPQFO JO@pMFOBNF S65' EPcJO@pMFc 'JMFPQFO PVU@pMFOBNF X65' EPcPVU@pMFc XIJMFUFYUJO@pMFHFUT PVU@pMFQVUTUFYUJGUFYUdB FOE FOE FOE JOͱPVUΛಉ࣌ʹ։͘ॻ͖ํͰ͢ɻ݁Ռ֨ೲ༻ͷ"SSBZ͕ෆཁʹͳΔͷͰ εοΩϦͰ͢ɻ 
  12. ԋश໰୊ʲ্ڃʳ4 ೔ຊͷ౎ಓ෎ݝͰɺஉੑͱঁੑͷਓޱ͕ࠩ࠷΋େ ͖͍ͷ͸Ͳ͔͜ɺσʔλ͔Βղੳ͍ͯͩ͘͠͞ɻ ! ώϯτɿσʔλ͸ҎԼʹ͋Γ·͢ɻ IUUQXXXFTUBUHPKQ4(FTUBU-JTUEP MJE உঁผਓޱٴͼੈଳͷछྨ ۠෼ ผੈଳ਺ͷ$47

    ώϯτɿจࣈྫΛΧϯϚͰ۠੾ͬͯ"SSBZʹ͢Δʹ͸ 4USJOHTQMJUΛ࢖͍·͢ɻ B C DTQMJU   <B C D> ࢲ΋·ͩॻ͍͍ͯͳ͍ͷͰɺ୭͔ॻ͚ͨΒίʔυΛࢲ·Ͱૹ͍ͬͯͩ͘͞ɻɿʣ