ش | ی | د | س | چ | پ | ج |
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
به زبان پایتون، برنامهای بنویسید که پیوسته دو عدد طبیعی را از کاربر دریافت و ک.م.م. (کوچکترین مضرب مشترک) آنها را محاسبه کند. همچنین اگر کاربر عددی کوچکتر از 1 را وارد کند، خروج از برنامه رخ دهد.
Write a program in Python which receives two natural numbers as input and calculates their LCM (least common multiple). If either of the two numbers is less than 1, exit the program.
ادامه مطلب ...
به زبان پایتون، برنامهای بنویسید که پیوسته صورت و مخرج یک کسر را دریافت و تا آنجایی که ممکن است آنها را ساده کند.
Write a program in Python which receives the numerator and the denominator of a fraction as input and reduces the fraction to its lowest terms.
به زبان پایتون، برنامهای بنویسید که پیوسته دو عدد طبیعی را دریافت کند و با الگوریتم اقلیدس، ب.م.م. (بزرگترین مقسومعلیه مشترک) آنها را محاسبه نماید. همچنین در صورتی که حداقل یکی از دو عدد کوچکتر از یک باشد، خروج از برنامه رخ دهد.
Write a program in Python which receives two natural numbers as input and computes their gcd (greatest common divisor) through Euclid's algorithm. If either of the two numbers is less than 1, exit the program.
ادامه مطلب ...به زبان پایتون، برنامهای بنویسید که پیوسته دو عدد صحیح a و b را از کاربر دریافت بکند و خارجقسمت و باقیماندهی تقسیم a بر b را در خروجی نشان بدهد و اگر b برابر با صفر باشد، خروج از برنامه صورت بگیرد.
Write a program in Python which continuously receives integers (a) and (b) as input. Considering (a) as dividend and (b) as divisor, it provides the quotient (q) and the remainder (r) as output. If (b) equals zero, the program is terminated.
ادامه مطلب ...به زبان پایتون، برنامهای بنویسید که دو عدد a و b را از کاربر دریافت کند و حاصلجمع، حاصلتفریق و حاصلضرب آنها را در خروجی نمایش دهد. (برای این که برنامه بتواند از پس اعداد اعشاری نیز برآید، a و b را به صورت متغیرهای float تعریف نمایید.)
Write a program in Python which receives two numbers as input and calculates their sum, their difference, and their product. (Define the two numbers as float variables so that the program can deal with decimals, too.)
ادامه مطلب ...