PrepIPA
テクノロジ系 2025年度 問99 ★★★★☆ Hard

Study topic for this question

ဤမေးခွန်းအတွက် လေ့လာရန် ခေါင်းစဉ်

More questions on the same topic

တူညီသောခေါင်းစဉ်မှ မေးခွန်းများ

IP 2025 Q78

What is the output when procedure calcMod3 is called? [Program] ○calcMod3() Integer: totalValue, i totalValue ← 0 for (i from 1 to 7, increment by 1) if (remainder of i ÷ 3 equals 0) totalValue ← totalValue + i endif endfor output totalValue

calcMod3 procedure ကို ခေါ်သောအခါ ထုတ်ပေးသော output မှာ အဘယ်နည်း? [Program] ○calcMod3() Integer: totalValue, i totalValue ← 0 for (i ကို 1 မှ 7 သို့ 1 စီ တိုးသည်) if (i ÷ 3 ၏ အကြွင်းသည် 0 နှင့် ညီ) totalValue ← totalValue + i endif endfor totalValue ကို ထုတ်ပြပါ

★★★★
IP 2025 Q98

When sorting 4 elements in ascending order by repeating the procedure below, how many times is the series of steps (1)-(3) executed until sorting is complete? Data: [27, 42, 33, 12] (1) Find the maximum in the sort target and swap it with the last element. (2) Remove the last element from the sort target. (3) If one or more elements remain, execute (1)-(3) again; otherwise, sorting is complete.

အောက်ပါ လုပ်ငန်းစဉ်ကို ထပ်ခါတလဲလဲ ဆောင်ရွက်ကာ ဒြပ်စင် ၄ ခု ပါဝင်သော ဒေတာကို ascending order ဖြင့် စီစဉ်ရာ sorting ပြီးစီးသည်အထိ (1)-(3) လုပ်ဆောင်ချက်များ မည်မျှ ကြိမ် ဆောင်ရွက်ရမည်နည်း? ဒေတာ: [27, 42, 33, 12] (1) sort target တွင် အကြီးဆုံးတန်ဖိုးကို ရှာဖွေ၍ နောက်ဆုံးဒြပ်စင်နှင့် လဲလှယ်သည်။ (2) နောက်ဆုံးဒြပ်စင်ကို sort target မှ ဖယ်ရှားသည်။ (3) sort target တွင် ဒြပ်စင် တစ်ခုနှင့်အထက် ကျန်ရှိပါက (1)-(3) ကို ထပ်ဆောင်ရွက်သည်; မကျန်ပါက sorting ပြီးစီးသည်။

★★★★