14-10-2010, 17:54
|
|
|
חבר מתאריך: 09.06.08
הודעות: 7,509
|
|
1)
קוד:
input a,b
1. if a = 0
1.1. if b ≠ 0
1.1.1. print "no real solution exists"
1.2. else
1.2.1. print "true for all x"
2. else
2.1. print "x=" -(b/a)
2)
קוד:
input n
1. new integers d1, d2
2. d1 = n modulo 10
3. n = floor(n/10)
4. while n>0
4.1. d2 = n modulo 10
4.2. if d2 ≥ d1
4.2.1. return false
4.3. d1 = d2
4.4. n = floor(n/10)
5. return true
3)
קוד:
input n
1. for i from 1 to n
1.1. for j from 2 to n
1.1.1. print i*j
1.2. print new line
בתכלס כל אחד רושם פסאודו קוד בדרך אחרת, העיקר שהשלבים יהיו מובנים.
אם יש לך שאלות אשמח לענות
|