|
|||
|
Dummy Solution
Try to optimize the code
#include<stdio.h> void main() { int i,j,k = 5, l=1; for(i = 0; i <=3 ; i++) { for(j = 0; j <=10 ; j++) { if ((i == 0) && (j == 0)) { printf("%d", l); l++; break; } if (i != j) { printf("%d ", l); l++; } if(i == j) { printf("%d ", l); l++; break; } } printf("\n"); } } |
|
|||
|
Hey, try it out
public void run() { int base = 14; for (int i = 0; i < base; i++) { for (int j = 1; j < BRICK_HEIGHT; j++) { int x = BRICK_WIDTH * i; int y = getHeight() - (BRICK_HEIGHT * j); GRect brick = new GRect(x, y, BRICK_WIDTH, BRICK_HEIGHT); add(brick); } } } |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-15-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:01 AM |
| comp.lang.c Answers to Frequently Asked Questions (FAQ List) | Steve Summit | Tech FAQ | 0 | 06-01-2004 07:00 AM |
| comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) | Steve Summit | Tech FAQ | 0 | 05-15-2004 07:00 AM |
| Apple II Csa2 FAQs: Telecom Hardware & Transfers, Part 20/25 | rubywand@swbell.net | Tech FAQ | 0 | 04-04-2004 08:29 AM |