# problem solve

• 04-26-2005
coolnarugodas
problem solve
can some one help me

the program is

input:7
output is

0000000
0111110
0122210
0123210
0122210
0111110
0000000

another
is
input:9

output

000000000
011111110
012222210
012333210
012343210
012333210
012222210
011111110
000000000

thank you for some can help me
• 04-26-2005
Togra
Did you try something yourself?
• 04-26-2005
pianorain
Sure.
Code:

#include<stdio.h> /*square*/
main(_,t,_t)int*t;{for(t=&_,
printf("input: "),scanf("%d"
,t),t=(int*)!(_t^_t),_t=_^_;
_t<_*_;printf("%d",(_t/_<_>>
(int)t?_t/_:_-_t/_-(int)t)<(
_t%_<_>>(int)t?_t%_:_-_t%_-(
int)t)?_t/_<_>>(int)t?_t/_:_
-_t/_-(int)t:_t%_<_>>(int)t?
_t%_:_-_t%_-+(int)t),!((_t+(
int)t)%_)&&printf("\n"),_t++
);return _t^_t*-+_<<(int)t;}

It behaves poorly when negative numbers are entered, but these things happen.

In all seriousness, exactly what kind of help do you need? Do you know and understand an algorithm for printing out that sort of square?
• 04-26-2005
dwks
Could you try to indent that code? I can't read it. Call me blind. :)
• 04-26-2005
quzah
Code:

#include<stdio.h> /*square*/
main(_,t,_t)int*t;{for(t=&_,
printf("input: "),scanf("%d"
,t),t=(int*)!(_t^_t),_t=_^_;
_t<_*_;printf("%d",(_t/_<_>>
(int)t?_t/_:_-_t/_-(int)t)<(
_t%_<_>>(int)t?_t%_:_-_t%_-(
int)t)?_t/_<_>>(int)t?_t/_:_
-_t/_-(int)t:_t%_<_>>(int)t?
_t%_:_-_t%_-+(int)t),!((_t+(
int)t)%_)&&printf("\n"),_t++
);return _t^_t*-+_<<(int)t;}

There ya go.

Quzah.
• 04-26-2005
joshdick
:D
Lol
• 04-26-2005
pianorain
Quote:

Originally Posted by quzah
There ya go.

Quzah.

Thanks Quzah. I was a little busy. ;)

I submit version 2.0 of square. It fixes that little negative number bug.
Code:

#include<stdio.h> /*square*/
main(_,t,_t)int*t;{for(t=&_,
printf("input: "),scanf("%d"
,t),t=(int*)!(_t^_t),_t=_^_;
_t<_*_&&+_>!(int)t;printf("\
%d",(+_t/_<_>>(int)t?_t/_:_-
_t/_-(int)t)<(_t%_<_>>(int)t
?_t%_:_-_t%_-(int)t)?+_t/_<_
>>(int)t?_t/_:_-_t/_-(int)t:
_t%_<_>>(int)t?_t%_:_-_t%_-(
int)t),+!((+_t+(int)t)%+_)&&
printf("\n"),_t++);return _t
^_t*-+_<<(int)t/(_+(int)t);}

• 04-26-2005
dwks
Ha ha. No, seriously.