![見出し画像](https://assets.st-note.com/production/uploads/images/116625941/rectangle_large_type_2_c69a2f950a359c682fc73491992fad8a.png?width=1200)
【アルゴリズム】値の入れ替え
2つの変数に入っている値を入れ替えたい時
例)オレンジジュースとぶどうジュースを入れ替えたい
![](https://assets.st-note.com/img/1695106884311-wlf3Ixj49Y.png?width=1200)
空のグラスを1個用意する
![](https://assets.st-note.com/img/1695107041517-mmIPVmgtC4.jpg)
ぶどうジュースを空のグラスに移す
![](https://assets.st-note.com/img/1695107117184-uawOhbohsO.jpg)
ぶどうジュースが入っていたグラスにオレンジジュースを移す
![](https://assets.st-note.com/img/1695107206117-sN8yLMJKhk.jpg)
オレンジジュースが入っていたグラスにぶどうジュースを移す
![](https://assets.st-note.com/img/1695107297831-GSBP34rcbb.jpg)
入れ替えられた!
![](https://assets.st-note.com/img/1695107394530-r7ciNxxS8K.jpg)
【問題】ITパスポート平成22年春期 問53
Youtube
Zenn
Twitter
https://twitter.com/kunchan2_](
いいなと思ったら応援しよう!
![企業研修・MS-Office・オンラインスクールプログラミング講師が楽しく教えるスキルアップブログ♪](https://assets.st-note.com/production/uploads/images/102369204/profile_2ee616d6f17d1ccef31c0b963357ed8e.png?width=600&crop=1:1,smart)