706 - LCD Display

All about problems in Volume 7. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
afonsocsc
New poster
Posts: 34
Joined: Mon Mar 24, 2003 1:15 am
Location: Portugal, Lisbon

Post by afonsocsc » Wed Oct 27, 2004 1:04 am

Hello,
try this input:
10 99999999
10 12345678

afonsocsc
New poster
Posts: 34
Joined: Mon Mar 24, 2003 1:15 am
Location: Portugal, Lisbon

Post by afonsocsc » Wed Oct 27, 2004 1:32 am

Hi,
I did a diff with your output and mine and here's the result:
Your program is printing one extra blank line in the beginning, and is adding one extra space at the end of each line.

Hope it helps

randomtaiwanese
New poster
Posts: 32
Joined: Fri Oct 01, 2004 10:53 pm

Post by randomtaiwanese » Mon Nov 01, 2004 9:10 pm

afonsocsc wrote:Hello,
try this input:
10 99999999
10 12345678
it works... with the new code, which is posted in the other topic
but i still get WA :(

randomtaiwanese
New poster
Posts: 32
Joined: Fri Oct 01, 2004 10:53 pm

Post by randomtaiwanese » Mon Nov 01, 2004 9:11 pm

afonsocsc wrote:Hi,
I did a diff with your output and mine and here's the result:
Your program is printing one extra blank line in the beginning, and is adding one extra space at the end of each line.

Hope it helps
this is new code, fixed the problems u have mentioned, but still WA :(

[java]
import java.io.IOException;
import java.util.StringTokenizer;

class Main
{
String[][] lcd;
int count=1;
int[] num;
int size, length;
char[] chars = new char[3];
final char space = ' ';
static String ReadLn(int maxLg)
{
byte lin[]=new byte[maxLg];
int lg=0,car=-1;
String line="";
try
{
while(lg<maxLg)
{
car=System.in.read();
if ((car<0)||(car=='\n'))
{
break;
}
lin[lg++]+=car;
}
}
catch(IOException e)
{
return(null);
}
if ((car<0)&&(lg==0))
{
return(null);
}
return (new String (lin, 0, lg));
}
public static void main(String[] args)
{
Main newMain = new Main();
newMain.start();
}
void start()
{
String input;
StringTokenizer tokenizer;
String m, n;
lcd = new String[11][3];
while ((input = Main.ReadLn (65535)) != null)
{
tokenizer=new StringTokenizer (input);
m=tokenizer.nextToken();
n=tokenizer.nextToken();
if((Integer.parseInt(m)==0)&&(Integer.parseInt(n)==0))
{
//here start drawing
for(int i=1;i<count;i++)
{
//System.out.println("");
size = Integer.parseInt(lcd[1]);
if(size>10)
break;
String str = lcd[2];
length = str.length();
num = new int[length];
for(int j=0;j<length;j++)
{
num[j] = Integer.parseInt(new Character(str.charAt(j)).toString());
}
//draw first line
setChar(0,0);
setChar(2,0);
for(int j=0;j<length;j++)
{
if((num[j]==1)||(num[j]==4))
setChar(1,0);
else
setChar(1,2);
draw();
if(j!=length-1)
drawBlank();
}
//second line
setChar(1,0);
for(int u=0;u<size;u++)
{
System.out.println("");
for(int j=0;j<length;j++)
{
if((num[j]==1)||(num[j]==2)||(num[j]==3)||(num[j]==7))
setChar(0,0);
else
setChar(0,1);
if((num[j]==5)||(num[j]==6))
setChar(2,0);
else
setChar(2,1);
draw();
if(j!=length-1)
drawBlank();
}
}
System.out.println("");
//third line
setChar(0,0);
setChar(2,0);
for(int j=0;j<length;j++)
{
if((num[j]==1)||(num[j]==7)||(num[j]==0))
setChar(1,0);
else
setChar(1,2);
draw();
if(j!=length-1)
drawBlank();
}
//forth line
setChar(1,0);
for(int u=0;u<size;u++)
{
System.out.println("");
for(int j=0;j<length;j++)
{
if(num[j]==2)
setChar(2,0);
else
setChar(2,1);
if((num[j]==2)||(num[j]==6)||(num[j]==8)||(num[j]==0))
setChar(0,1);
else
setChar(0,0);
draw();
if(j!=length-1)
drawBlank();
}
}
System.out.println("");
//fifth line
setChar(0,0);
setChar(2,0);
for(int j=0;j<length;j++)
{
if((num[j]==1)||(num[j]==4)||(num[j]==7))
setChar(1,0);
else
setChar(1,2);
draw();
if(j!=length-1)
drawBlank();
}
if(i!=count-1)
{
System.out.println("");
System.out.println("");
}
}
System.out.println("");
break;
}
else
{
lcd[count][1]=m;
lcd[count][2]=n;
count++;
}
}
}
void drawBlank()
{
System.out.print(space);
}
void setChar(int charnum, int chartype)
{
switch(chartype)
{
case 0:
chars[charnum]=space;
break;
case 1:
chars[charnum]='|';
break;
case 2:
chars[charnum]='-';
break;
}
}
void draw()
{
System.out.print(chars[0]);
for(int l=0;l<size;l++)
{
System.out.print(chars[1]);
}
System.out.print(chars[2]);
}
}[/java]

afonsocsc
New poster
Posts: 34
Joined: Mon Mar 24, 2003 1:15 am
Location: Portugal, Lisbon

Post by afonsocsc » Tue Nov 02, 2004 1:42 am

Why are you storing the input in an array?
If the input has more than 10 lines (excluding the last), your program will have an ArrayIndexOutOfBoundsException

You should process each line as you read it.

.pandre.
New poster
Posts: 9
Joined: Mon Nov 08, 2004 10:58 pm
Location: Coimbra, Portugal

706: can't understand why WA, can someone help me?

Post by .pandre. » Thu Nov 11, 2004 2:40 am

hello everyone

I'm having great troubles with this nasty, tricky problem; I think I have the right answers, but the judge doesn't seem to agree with me :(

my ouputs for:
2 12345
3 67890
10 99999999
10 0
5 1094
4 11111
3 18818818
1 0
2 0
3 0
8 31415
2 007
0 0

are:

Code: Select all

 ---------- 
|          |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
            
|          |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
|          |
 ---------- 

         -----   -----         
      | |     | |     | |     |
      | |     | |     | |     |
      | |     | |     | |     |
      | |     | |     | |     |
      | |     | |     | |     |
                 -----   ----- 
      | |     |       |       |
      | |     |       |       |
      | |     |       |       |
      | |     |       |       |
      | |     |       |       |
         -----   -----         

                                  
     |      |      |      |      |
     |      |      |      |      |
     |      |      |      |      |
     |      |      |      |      |
                                  
     |      |      |      |      |
     |      |      |      |      |
     |      |      |      |      |
     |      |      |      |      |
                                  

       ---   ---         ---   ---         --- 
    | |   | |   |     | |   | |   |     | |   |
    | |   | |   |     | |   | |   |     | |   |
    | |   | |   |     | |   | |   |     | |   |
       ---   ---         ---   ---         --- 
    | |   | |   |     | |   | |   |     | |   |
    | |   | |   |     | |   | |   |     | |   |
    | |   | |   |     | |   | |   |     | |   |
       ---   ---         ---   ---         --- 

 - 
| |
   
| |
 - 

 -- 
|  |
|  |
    
|  |
|  |
 -- 

 --- 
|   |
|   |
|   |
     
|   |
|   |
|   |
 --- 

 --------                                    -------- 
         |          | |        |          | |         
         |          | |        |          | |         
         |          | |        |          | |         
         |          | |        |          | |         
         |          | |        |          | |         
         |          | |        |          | |         
         |          | |        |          | |         
         |          | |        |          | |         
 --------              --------              -------- 
         |          |          |          |          |
         |          |          |          |          |
         |          |          |          |          |
         |          |          |          |          |
         |          |          |          |          |
         |          |          |          |          |
         |          |          |          |          |
         |          |          |          |          |
 --------                                    -------- 

 --   --   -- 
|  | |  |    |
|  | |  |    |
              
|  | |  |    |
|  | |  |    |
 --   --      

if you prefer, by replacing the blanks with dots (".") I get this output:

Code: Select all

......--...--........--.
...|....|....|.|..|.|...
...|....|....|.|..|.|...
......--...--...--...--.
...|.|.......|....|....|
...|.|.......|....|....|
......--...--........--.

.---...---...---...---...---.
|.........|.|...|.|...|.|...|
|.........|.|...|.|...|.|...|
|.........|.|...|.|...|.|...|
.---.........---...---.......
|...|.....|.|...|.....|.|...|
|...|.....|.|...|.....|.|...|
|...|.....|.|...|.....|.|...|
.---.........---...---...---.

.----------...----------...----------...----------...----------...----------...----------...----------.
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|.|..........|
.----------...----------...----------...----------...----------...----------...----------...----------.
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
...........|............|............|............|............|............|............|............|
.----------...----------...----------...----------...----------...----------...----------...----------.

.----------.
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
............
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
|..........|
.----------.

.........-----...-----.........
......|.|.....|.|.....|.|.....|
......|.|.....|.|.....|.|.....|
......|.|.....|.|.....|.|.....|
......|.|.....|.|.....|.|.....|
......|.|.....|.|.....|.|.....|
.................-----...-----.
......|.|.....|.......|.......|
......|.|.....|.......|.......|
......|.|.....|.......|.......|
......|.|.....|.......|.......|
......|.|.....|.......|.......|
.........-----...-----.........

..................................
.....|......|......|......|......|
.....|......|......|......|......|
.....|......|......|......|......|
.....|......|......|......|......|
..................................
.....|......|......|......|......|
.....|......|......|......|......|
.....|......|......|......|......|
.....|......|......|......|......|
..................................

.......---...---.........---...---.........---.
....|.|...|.|...|.....|.|...|.|...|.....|.|...|
....|.|...|.|...|.....|.|...|.|...|.....|.|...|
....|.|...|.|...|.....|.|...|.|...|.....|.|...|
.......---...---.........---...---.........---.
....|.|...|.|...|.....|.|...|.|...|.....|.|...|
....|.|...|.|...|.....|.|...|.|...|.....|.|...|
....|.|...|.|...|.....|.|...|.|...|.....|.|...|
.......---...---.........---...---.........---.

.-.
|.|
...
|.|
.-.

.--.
|..|
|..|
....
|..|
|..|
.--.

.---.
|...|
|...|
|...|
.....
|...|
|...|
|...|
.---.

.--------....................................--------.
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.........|..........|.|........|..........|.|.........
.--------..............--------..............--------.
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.........|..........|..........|..........|..........|
.--------....................................--------.

.--...--...--.
|..|.|..|....|
|..|.|..|....|
..............
|..|.|..|....|
|..|.|..|....|
.--...--......

is there any wrong output?
is there something missing?

I would be very glad if a good soul would help me because I've been stuck with this problem for a long time

Maniac
Experienced poster
Posts: 105
Joined: Tue Oct 14, 2003 3:24 pm
Location: Utrecht, Holland

Post by Maniac » Sun Nov 14, 2004 3:31 pm

for problems with the problemset, don't post here but at the forum-part specially meant for that. There you'll also probably find out about other peoples troubles with this problem etc. Good luck!

SePulTribe
New poster
Posts: 28
Joined: Mon Nov 15, 2004 5:00 pm

706 LC-Display Presentation Error

Post by SePulTribe » Mon Nov 15, 2004 5:17 pm

I know a PE doesn't mean much to many people but it does to me. I'm stumped as to how to make my output perfect. Here is my code. Please help. Thanks in advance!

[c]#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int factor, digits[8], last, temp, ii, jj, zz;
char toprint, t[2];
char code[10][7] = {
{ 1, 1, 1, 0, 1, 1, 1 }, { 0, 0, 1, 0, 0, 1, 0 },
{ 1, 0, 1, 1, 1, 0, 1 }, { 1, 0, 1, 1, 0, 1, 1 },
{ 0, 1, 1, 1, 0, 1, 0 }, { 1, 1, 0, 1, 0, 1, 1 },
{ 1, 1, 0, 1, 1, 1, 1 }, { 1, 0, 1, 0, 0, 1, 0 },
{ 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 0, 1, 1 }
};

t[1] = '\0';
while (scanf("%d ", &factor) != EOF)
{
if (!factor)
break;
last = 0;
while ((toprint = (char)getc(stdin)) != '\n' && toprint != EOF)
{
t[0] = toprint;
digits[last++] = atoi(t);
}
for (ii = 0; ii < last; ii++)
{
toprint = (code[digits[ii]][0]) ? '-' : ' ';
printf(" ");
for (jj = 0; jj < factor; jj++)
printf("%c", toprint);
if (ii != last - 1)
printf(" ");
}
printf("\n");
for (ii = 0; ii < factor; ii++)
{
for (jj = 0; jj < last; jj++)
{
toprint = (code[digits[jj]][1]) ? '|' : ' ';
printf("%c", toprint);
for (zz = 0; zz < factor; zz++)
printf(" ");
toprint = (code[digits[jj]][2]) ? '|' : ' ';
printf("%c", toprint);
if (jj != last - 1)
printf(" ");
}
printf("\n");
}
for (ii = 0; ii < last; ii++)
{
toprint = (code[digits[ii]][3]) ? '-' : ' ';
printf(" ");
for (jj = 0; jj < factor; jj++)
printf("%c", toprint);
if (ii != last - 1)
printf(" ");
}
printf("\n");
for (ii = 0; ii < factor; ii++)
{
for (jj = 0; jj < last; jj++)
{
toprint = (code[digits[jj]][4]) ? '|' : ' ';
printf("%c", toprint);
for (zz = 0; zz < factor; zz++)
printf(" ");
toprint = (code[digits[jj]][5]) ? '|' : ' ';
printf("%c", toprint);
if (jj != last - 1)
printf(" ");
}
printf("\n");
}
for (ii = 0; ii < last; ii++)
{
toprint = (code[digits[ii]][6]) ? '-' : ' ';
printf(" ");
for (jj = 0; jj < factor; jj++)
printf("%c", toprint);
if (ii != last - 1)
printf(" ");
}
printf("\n\n");
}
return 0;
}
[/c]

User avatar
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker » Tue Nov 16, 2004 5:49 am

Hi try this out :)

here '*' means space :wink:

Code: Select all


your output:

3 0

*---
|***|
|***|
|***|
****
|***|
|***|
|***|
*---

my output:

3 0

*---*
|***|
|***|
|***|
*****
|***|
|***|
|***|
*---*


check out the last asteriks, u cant just keep it empty , u have to fill the whole size with space or either '|' or '-'

i hope u will pass PE this time......and u know how to modify ur code....

Goodluck :wink: 
Jalal : AIUB SPARKS

SePulTribe
New poster
Posts: 28
Joined: Mon Nov 15, 2004 5:00 pm

Doesn't work

Post by SePulTribe » Tue Nov 16, 2004 5:38 pm

Hmm did what you said, but it still didn't work. :(

Here's my modified code:
[c]#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int factor, digits[8], last, temp, ii, jj, zz;
char toprint, t[2];
char code[10][7] = {
{ 1, 1, 1, 0, 1, 1, 1 }, { 0, 0, 1, 0, 0, 1, 0 },
{ 1, 0, 1, 1, 1, 0, 1 }, { 1, 0, 1, 1, 0, 1, 1 },
{ 0, 1, 1, 1, 0, 1, 0 }, { 1, 1, 0, 1, 0, 1, 1 },
{ 1, 1, 0, 1, 1, 1, 1 }, { 1, 0, 1, 0, 0, 1, 0 },
{ 1, 1, 1, 1, 1, 1, 1 }, { 1, 1, 1, 1, 0, 1, 1 }
};

t[1] = '\0';
while (scanf("%d ", &factor) != EOF)
{
if (!factor)
break;
last = 0;
while ((toprint = (char)getc(stdin)) != '\n' && toprint != EOF)
{
t[0] = toprint;
digits[last++] = atoi(t);
}
for (ii = 0; ii < last; ii++)
{
toprint = (code[digits[ii]][0]) ? '-' : ' ';
printf(" ");
for (jj = 0; jj < factor; jj++)
printf("%c", toprint);
if (ii != last - 1)
printf(" ");
}
printf(" ");
printf("\n");
for (ii = 0; ii < factor; ii++)
{
for (jj = 0; jj < last; jj++)
{
toprint = (code[digits[jj]][1]) ? '|' : ' ';
printf("%c", toprint);
for (zz = 0; zz < factor; zz++)
printf(" ");
toprint = (code[digits[jj]][2]) ? '|' : ' ';
printf("%c", toprint);
if (jj != last - 1)
printf(" ");
}
printf("\n");
}
for (ii = 0; ii < last; ii++)
{
toprint = (code[digits[ii]][3]) ? '-' : ' ';
printf(" ");
for (jj = 0; jj < factor; jj++)
printf("%c", toprint);
if (ii != last - 1)
printf(" ");
}
printf(" ");
printf("\n");
for (ii = 0; ii < factor; ii++)
{
for (jj = 0; jj < last; jj++)
{
toprint = (code[digits[jj]][4]) ? '|' : ' ';
printf("%c", toprint);
for (zz = 0; zz < factor; zz++)
printf(" ");
toprint = (code[digits[jj]][5]) ? '|' : ' ';
printf("%c", toprint);
if (jj != last - 1)
printf(" ");
}
printf("\n");
}
for (ii = 0; ii < last; ii++)
{
toprint = (code[digits[ii]][6]) ? '-' : ' ';
printf(" ");
for (jj = 0; jj < factor; jj++)
printf("%c", toprint);
if (ii != last - 1)
printf(" ");
}
printf(" ");
printf("\n\n");
}
return 0;
}
[/c]

SePulTribe
New poster
Posts: 28
Joined: Mon Nov 15, 2004 5:00 pm

Post by SePulTribe » Tue Nov 16, 2004 6:51 pm

Hey thanks! It works on this judge but not the programming-challenges one. Haiz. The programming-challenges judge is so irritating.

User avatar
CodeMaker
Experienced poster
Posts: 183
Joined: Thu Nov 11, 2004 12:35 pm
Location: AIUB, Bangladesh

Post by CodeMaker » Wed Nov 17, 2004 4:38 am

Well happy to hear that ur problem is solved....

I did not tried it in programming challenges judge.....but if the problem descriction is same then it should have worked......

but u can try one thing there......cut out newline after the last output. now question is how u will undestand which one is last input?.....

well there is a way, u can print newline before each output except the 1st one and thats not so hard, actually I solved it in this way at the 1st time and this judge gave me PE......then i print newline after each case and got Acc, so there is a possibility that the opposite happens in programming challenges judge.......but dont try anything else, because i dont think that will work

:D well, goodbye and goodluck.......
Jalal : AIUB SPARKS

SePulTribe
New poster
Posts: 28
Joined: Mon Nov 15, 2004 5:00 pm

Post by SePulTribe » Wed Nov 17, 2004 7:54 am

Hey thanks but it still doesn't work. I'm so frustrated. :(

rahurprem
New poster
Posts: 10
Joined: Mon Mar 28, 2005 5:59 pm
Location: Dhaka, Bangladesh
Contact:

706

Post by rahurprem » Mon Mar 28, 2005 6:11 pm

Could you please help me with my code? The judge answered "WRONG ANSWER". I don't understand why.

Is there any special input present, what my code didn't consider?
I didn't consider NEGATIVE numbers
I didn't consider SIZE = 0
I didn't consider LEADING ZEROs.

This is my code

Code: Select all


//Wrong answer
#include<stdio.h>
#include<math.h>

char a[10][5][3]=
{
	//ZERO
	' ','-',' ',
	'|',' ','|',
	' ',' ',' ',
	'|',' ','|',
	' ','-',' ',

	//ONE
	' ',' ',' ',
	' ',' ','|',
	' ',' ',' ',
	' ',' ','|',
	' ',' ',' ',


	//TWO
	' ','-',' ',
	' ',' ','|',
	' ','-',' ',
	'|',' ',' ',
	' ','-',' ',

	//THREE
	' ','-',' ',
	' ',' ','|',
	' ','-',' ',
	' ',' ','|',
	' ','-',' ',

	//FOUR
	' ',' ',' ',
	'|',' ','|',
	' ','-',' ',
	' ',' ','|',
	' ',' ',' ',

	//FIVE
	' ','-',' ',
	'|',' ',' ',
	' ','-',' ',
	' ',' ','|',
	' ','-',' ',

	//SIX
	' ','-',' ',
	'|',' ',' ',
	' ','-',' ',
	'|',' ','|',
	' ','-',' ',

	//SEVEN
	' ','-',' ',
	' ',' ','|',
	' ',' ',' ',
	' ',' ','|',
	' ',' ',' ',

	//EIGHT
	' ','-',' ',
	'|',' ','|',
	' ','-',' ',
	'|',' ','|',
	' ','-',' ',

	//NINE
	' ','-',' ',
	'|',' ','|',
	' ','-',' ',
	' ',' ','|',
	' ','-',' ',

};
	
int main()
{
//	freopen("706.in","r",stdin);
//	freopen("706.txt","w",stdout);

	int s, n;
	int backup,digitCount,i,j;
	int process;
	int power;
	int k,l,x;
	int Count=0;
	int flag=0;
	int flag2=0;
	int linef=0;


	while( (scanf("%d%d",&s,&n)==2)&&(s||n))
	{
		if(flag2)
			printf("\n");
		flag2=1;
		backup = n;
		digitCount = (int)floor(log10(n))+1;

		for(i=0; i<5; )
		{	
			flag=0;
			for(j=digitCount-1; j>=0; j--)
			{
				if(flag)
					printf(" ");
				flag=1;

				power = (int)pow(10,j);
				
				process = n/power;
				n = n%power;
				
				int minus=0;
				int line=0;
				
				for(x=0; x<3; x++)
				{
					if(a[process][i][x]=='-')
					{
						minus=1;
						break;
					}
					if(a[process][i][x]=='|')
					{
						line=1;						
						break;
					}
				}

				if(minus)
				{
					minus=0;

					for(k=0; k<3; k++)
					{						
						if(a[process][i][k]=='-'||(a[process][i][k]==' '&&k==1))
						{
							for(l=0; l<s; l++)
							{
								printf("%c",a[process][i][k]);
							}
						}
						else
						{
							printf("%c",a[process][i][k]);
						}						
					}							
				}
				else if(line)
				{
					linef =1;
					if(Count<s)
					{					
						line=0;
						for(k=0; k<3; k++)
						{
							if(a[process][i][k]=='|')
							{
								printf("%c",a[process][i][k]);
							}
							else
							{
								if(a[process][i][k]==' '&&k==1)
								{
									for(l=0; l<s; l++)
									{
										printf("%c",a[process][i][k]);
									}
								}
								else
								{
									printf("%c",a[process][i][k]);
								}							
							}
						}						
					}										
				}							
				else
				{
					for(k=0; k<3; k++)
					{
						if(a[process][i][k]==' '&&k==1)
						{
							for(l=0; l<s; l++)
							{
								printf("%c",a[process][i][k]);
							}
						}
						else
						{
							printf("%c",a[process][i][k]);
						}							
					}										
				}
				if(Count==s)Count=0;				
			}
			printf("\n");
			if(linef)
			{
				Count++;
				linef=0;
			}
			n = backup;
			
			if(Count==s)Count=0;
			if(Count==0){i++;}						
		}		
	}
	return 0;
}

Programmer? No, no, i am a speedy typist.

Raiyan Kamal
Experienced poster
Posts: 106
Joined: Thu Jan 29, 2004 12:07 pm
Location: Bangladesh
Contact:

Post by Raiyan Kamal » Mon Mar 28, 2005 6:58 pm

You have to consider leading zeroes. If there is one or more leading zeroes, you have to show them in the output

Post Reply

Return to “Volume 7 (700-799)”