<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.algopedia.ro/wiki/index.php?action=history&amp;feed=atom&amp;title=Introductory_Exercises</id>
	<title>Introductory Exercises - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.algopedia.ro/wiki/index.php?action=history&amp;feed=atom&amp;title=Introductory_Exercises"/>
	<link rel="alternate" type="text/html" href="https://www.algopedia.ro/wiki/index.php?title=Introductory_Exercises&amp;action=history"/>
	<updated>2026-04-12T21:51:17Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.algopedia.ro/wiki/index.php?title=Introductory_Exercises&amp;diff=1640&amp;oldid=prev</id>
		<title>Cristian: Added another exercise</title>
		<link rel="alternate" type="text/html" href="https://www.algopedia.ro/wiki/index.php?title=Introductory_Exercises&amp;diff=1640&amp;oldid=prev"/>
		<updated>2010-11-15T12:43:51Z</updated>

		<summary type="html">&lt;p&gt;Added another exercise&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Introductory Exercises =&lt;br /&gt;
&lt;br /&gt;
This is a small list of exercises for beginners. Some of them require minimal math knowledge. I will try and make references to that knowledge, when possible.&lt;br /&gt;
&lt;br /&gt;
== Problems with numbers (no sequences as input) ==&lt;br /&gt;
&lt;br /&gt;
=== First Degree Equation &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Solve the first degree equation with one variable: &amp;lt;code&amp;gt;ax + b = 0&amp;lt;/code&amp;gt;, given &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; as input.&lt;br /&gt;
=== Second Degree Equation &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Solve the second degree equation with one variable: &amp;lt;code&amp;gt;ax&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt; + bx + c = 0&amp;lt;/code&amp;gt;, given &amp;lt;code&amp;gt;a, b&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;c&amp;lt;/code&amp;gt; as input.&lt;br /&gt;
=== Divisibility Test &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Find out if &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is divisible by &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;.&lt;br /&gt;
=== Leap Year Test &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Find out if year &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; is a leap year.&lt;br /&gt;
=== k&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; digit ===&lt;br /&gt;
Extract the k&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; digit of a number, counting digits from right to left&lt;br /&gt;
=== Triangle Edges &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Can three input numbers be the lengths of the three edges of a triangle?&lt;br /&gt;
=== Swap Variables &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Given variables &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; exchange their values so that in the end &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; will contain the old value of &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; will contain the old value of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;.&lt;br /&gt;
=== Swap Variables Restricted &amp;lt;sup&amp;gt;i h&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Given variables &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; exchange their values so that in the end &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; will contain the old value of &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; will contain the old value of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;, &amp;#039;&amp;#039;&amp;#039;without&amp;#039;&amp;#039;&amp;#039; using any other variables.&lt;br /&gt;
&lt;br /&gt;
=== Divisors ===&lt;br /&gt;
Display all of number &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&amp;#039;s divisors.&lt;br /&gt;
=== Primality ===&lt;br /&gt;
Is number &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; a prime number?&lt;br /&gt;
=== Reverse Digits ===&lt;br /&gt;
Display in reverse order the digits of a number &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;&lt;br /&gt;
=== Multiple Count &amp;lt;sup&amp;gt;i h&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
How many integers divisible by &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; lie in interval &amp;lt;code&amp;gt;[a, b]&amp;lt;/code&amp;gt;?&lt;br /&gt;
=== Leap Year Count &amp;lt;sup&amp;gt;i h&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
How many years between &amp;lt;code&amp;gt;y1&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y2&amp;lt;/code&amp;gt; are leap years?&lt;br /&gt;
=== Palindrome &amp;lt;sup&amp;gt;h&amp;lt;/sup&amp;gt; ===&lt;br /&gt;
Is number &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; a [[http://en.wikipedia.org/wiki/Palindrome palindrome]]? A palindrome is a symmetrical number, like 15351 or 12233221.&lt;br /&gt;
=== Sort numbers &amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt;===&lt;br /&gt;
Display three input integers in ascending order.&lt;br /&gt;
=== Sort more numbers &amp;lt;sup&amp;gt;i h&amp;lt;/sup&amp;gt;===&lt;br /&gt;
Display five input integers in ascending order. Make the flow chart fit on one letter page.&lt;br /&gt;
=== GCD and LCM ===&lt;br /&gt;
Find the [[http://en.wikipedia.org/wiki/Gcd greates common divisor]] and the [[http://en.wikipedia.org/wiki/Lowest_common_multiple lowest common multiple]] of two numbers. Use [[http://en.wikipedia.org/wiki/Euclidean_algorithm Euclid&amp;#039;s algorithm]]. Example: GCD of 24 and 32 is 8.&lt;br /&gt;
=== Prime Factors ===&lt;br /&gt;
Display the [[http://en.wikipedia.org/wiki/Prime_factors prime factor decomposition]] of input number &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt;. Example: 1176 = 2&amp;lt;sup&amp;gt;3&amp;lt;/sup&amp;gt; x 3&amp;lt;sup&amp;gt;1&amp;lt;/sup&amp;gt; x 7&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;&lt;br /&gt;
=== Numbers with two digits ===&lt;br /&gt;
Is number &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; formed with exactly 2 digits repeated any number of times? 23223 and 900990 are such numbers, while 593 and 44002 are not.&lt;br /&gt;
=== Decimal Fraction &amp;lt;sup&amp;gt;h&amp;lt;/sup&amp;gt;===&lt;br /&gt;
Display fraction &amp;lt;code&amp;gt;m/n&amp;lt;/code&amp;gt; in decimal format, with the period between brackets. Example: 13/30 = 0.4(3)&lt;br /&gt;
=== Number Guessing ===&lt;br /&gt;
Guess a number between 1 and 1024 by asking questions of the form &amp;quot;is the number greater or equal to x&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Legend:&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;i&amp;lt;/sup&amp;gt;&amp;#039;&amp;#039;&amp;#039; means that the problem can be solved without loops, using only &amp;#039;&amp;#039;&amp;#039;i&amp;#039;&amp;#039;&amp;#039;f-then-else structures.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;&amp;lt;sup&amp;gt;h&amp;lt;/sup&amp;gt;&amp;#039;&amp;#039;&amp;#039; means &amp;#039;&amp;#039;&amp;#039;h&amp;#039;&amp;#039;&amp;#039;ard. The problem is difficult.&lt;/div&gt;</summary>
		<author><name>Cristian</name></author>
	</entry>
</feed>