|
Triangle lines of numbers
|
|
02-05-2010, 11:04 PM
Post: #1
|
|||
|
|||
|
Triangle lines of numbers
This is an interesting task. You need to input a number "n" that represents number of lines, like on the picture :
![]() That is simple algorithm, though the biggest problem is to make a Equilateral Triangle and not Right Triangle. I made it with 3 for loops, two inside of one, but it can be made with one too. Here is the solution in TPW : Code: program lines_of_numbers;![]() Also code in C++ : Code: # include <iostream>![]() That's all, i hope that you like this small task !!! We attack any new problem we encounter with techniques we already know, and try small modifications if difficulties turn up. Bram Cohen - Bit Torrent Creator |
|||
|
02-06-2010, 12:38 PM
(This post was last modified: 02-06-2010 12:52 PM by codecaine.)
Post: #2
|
|||
|
|||
|
RE: Triangle lines of numbers
here a python example I did I used center for formating
Code: import sys;PHP Code: Enter in a number: 20 |
|||
|
02-06-2010, 06:08 PM
Post: #3
|
|||
|
|||
|
RE: Triangle lines of numbers
Very good code, also it is short !
We attack any new problem we encounter with techniques we already know, and try small modifications if difficulties turn up. Bram Cohen - Bit Torrent Creator |
|||
|
« Next Oldest | Next Newest »
|



![[Image: 38227_linesofnumberstask.jpg]](http://myph.us/pics/38227_linesofnumberstask.jpg)
![[Image: 38228_linesofnumberstpwsolution.jpg]](http://myph.us/pics/38228_linesofnumberstpwsolution.jpg)
![[Image: 38226_linesofnumberscppsolution.jpg]](http://myph.us/pics/38226_linesofnumberscppsolution.jpg)


