Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _____
- /
- /
- /
- /___
- Input:
- 3 71%
- Output:
- _______
- x xx/
- xxx/
- x/
- /
- /
- /__xx_
- Input:
- 5 52%
- Output:
- ___________
- /
- xx xx/
- xxxxx/
- xxx/
- x/
- /
- /
- /
- / xxx
- /xxxxxxxxx
- Input:
- 6 75%
- Output:
- _____________
- x x/
- xxxxxxxxx/
- xxxxxxx/
- xxxxx/
- xxx/
- x/
- /
- /
- /
- /
- /
- /_xxxxxxxxx_
- );' ': /(~:
- ;0=~100.@-
- .**/:t;'_':&&
- *.n
- ,{:y *.'\'+{[&'x':x]0t(:t>=}:S~
- (y-,{;S+S+.}%;'/'+++}%.{&/ *}%-1%{-1%x/ *&/x*}%) /&[*]++n*
- 2n+1
- x__xx/
- xxx/
- x/
- /x
- /xxx
- /xx__x
- /
- /
- / xx
- /
- /
- /__xx_
- #include<stdio.h>
- #include<memory.h>
- #include<stdlib.h>
- #define p printf
- int h,c,*l,i,w,j,*q,k;const char*
- z;int main(int argc,char**argv)
- {h=atoi(argv[1]);c=(h*h*atoi(
- argv[2])+99)/100;l=new int[
- h*3];for(q=l,i=0,w=1;i<h;
- i++,c=(c-w)&~((c-w)>>31
- ),w+=2)if(c>=w){*q++=
- 0;*q++ =0;* q++=w;}
- else {*q++=(c+1)/
- 2;*q++=w-c;*q++
- =c/2;}p("_");
- for(i=0;i<h
- ;i ++)p (
- "__");p
- ("n"
- );q
- =
- l+h
- *3-1;
- for (i=
- --h;i>=0;
- i--){p("%*"
- "s\",h-i,"")
- ; z= "x x";
- for(k=0;k<3;k++,q
- --,z+=2)for(j=0;j<*
- q;j++)p(z);q-=0;p("/"
- "n");}q=l;for(i=0;i<=h
- ;i++){z =i==h? "_ x _":
- " x ";p("%*s/",h-i,"");
- for(k=0;k<3;k++,q++,z+=2)for(
- j=0;j<*q;j++)p(z);p("\n") ;}}
- #include <stdio.h>
- #include <memory.h>
- #include <stdlib.h>
- #define p printf
- int h, c, *l, i, w, j, *q, k;
- const char *z;
- int main(int argc, char** argv)
- {
- h = atoi(argv [1]);
- c = (h*h*atoi(argv[2])+99)/100;
- l = new int[h*3];
- for (q = l,i = 0,w = 1; i<h; i++,c = (c-w)&~((c-w)>>31),w += 2) {
- if (c>=w) {
- *q++ = 0;
- *q++ = 0;
- *q++ = w;
- } else {
- *q++ = (c+1)/2;
- *q++ = w-c;
- *q++ = c/2;
- }
- }
- p("_");
- for (i = 0; i<h; i++) {
- p("__");
- }
- p("n");
- q = l+h*3-1;
- for (i = --h; i>=0; i--) {
- p("%*s\",h-i,"");
- z = "x x";
- for (k = 0; k<3; k++,q--,z += 2) {
- for (j = 0; j<*q; j++) {
- p(z);
- }
- }
- p("/n");
- }
- q = l;
- for (i = 0; i<=h; i++) {
- z = i==h ? "_ x _" : " x ";
- p("%*s/",h-i,"");
- for (k = 0; k<3; k++,q++,z += 2) {
- for (j = 0; j<*q; j++) {
- p(z);
- }
- }
- p("\n") ;
- }
- }
- $S=-int((1-.01*pop)*($N=pop)*$N)+$N*$N;$S-=$s=$S>++$r?$r:$S,
- $=$/.$"x$N."\".x x($v=$s/2).$"x($t=$r++-$s).x x($w=$v+.5)."/$
- ".$"x$N."/".($^=$N?$":_)x$w.x x$t.$^x$v."\"while$N--;print$^x++$r
- $S=-int((1-.01*pop)*($N=pop
- ) *
- $ N
- ) +
- $ N
- *$N;( ${B},$
- F,${x})=qw(\ / x
- );while($N){;/l
- ater/g;$S-=$s
- =$S>++$r?$r
- :$S;'than
- you';@o
- =(" "
- x--
- $ N
- . $
- B .
- x x
- ( $
- v =
- $ s
- / 2
- ) .$"x($t= $
- r++-$s).x x($w=$v+.5)
- .$F,@o,$"x$N.$F.($^=$N?
- $":_)x$w.x x$t.$^x$v.$B);
- $,=$/}print$^x++$r,@o;think
- N,p=map(int,raw_input()[:-1].split())
- S=N*N-N*N*(100-p)/100
- _,e,x,b,f,n=C='_ x/n'
- o=""
- r=1
- while N:N-=1;z=C[N>0];s=min(S,r);S-=s;t=r-s;v=s/2;w=s-v;r+=2;o=n+e*N+b+x*v+e*t+x*w+f+o+n+e*N+f+z*w+x*t+z*v+b
- print _*r+o
- x n c=h s++'n':reverse(h(flip s)) where h s=r w '-'++s '+' b(w-2)0 p;w=(t n);p=d(n*n*c)100
- s x n i o p|i>0='n':l++s x n(i-2)(o+1)(max(p-i)0)|True=[] where l=r o b++'\':f d++r(i#p)n++f m++'/':r o b;f g=r(g(i-(i#p))2)x
- b=' '
- r=replicate
- t n=1+2*n
- d=div
- (#)=min
- m=(uncurry(+).).divMod
- #include<iostream>
- #include<string>
- #include<cstdlib>
- #include<cmath>
- using namespace std;
- typedef string S;
- typedef int I;
- typedef char C;
- I main(I,C**v){
- I z=atoi(v[1]),c=z*z,f=ceil(c*atoi(v[2])/100.);
- cout<<S(z*2+1,'_')<<'n';
- for(I i=z,n=c;i;--i){
- I y=i*2-1;
- S s(y,' ');
- C*l=&s[0];
- C*r=&s[y];
- for(I j=0;j<y;++j)
- if(n--<=f)*((j&1)?l++:--r)='x';
- cout<<S(z-i,' ')<<'\'<<s<<"/n";
- }
- for(I i=1,n=c-f;i<=z;++i){
- I y=i*2-1;
- S s(y,'x');
- C*l=&s[0];
- C*r=&s[y];
- for(I j=0;j<y;++j)
- if(n++<c)*(!(j&1)?l++:--r)=(i==z)?'_':' ';
- cout<<S(z-i,' ')<<'/'<<s<<"\n";
- }
- }
- #include<iostream>
- #include<string>
- #include<cstdlib>
- #include<cmath>
- using namespace std;typedef string S;typedef int I;typedef char C;I main(I,C**v){I z=atoi(v[1]),c=z*z,f=ceil(c*atoi(v[2])/100.);cout<<S(z*2+1,'_')<<'n';for(I i=z,n=c;i;--i){I y=i*2-1;S s(y,' ');C*l=&s[0];C*r=&s[y];for(I j=0;j<y;++j)if(n--<=f)*((j&1)?l++:--r)='x';cout<<S(z-i,' ')<<'\'<<s<<"/n";}for(I i=1,n=c-f;i<=z;++i){I y=i*2-1;S s(y,'x');C*l=&s[0];C*r=&s[y];for(I j=0;j<y;++j)if(n++<c)*(!(j&1)?l++:--r)=(i==z)?'_':' ';cout<<S(z-i,' ')<<'/'<<s<<"\n";}}
- function f () { for i in `seq $1`;do printf "$2";done; }
- N=$1;S=$[$1*$1-$1*$1*$[100-${2/%/}]/100]
- b='';o=$b;n="n";r=1;while [ $N -gt 0 ];do
- N=$[N-1];z=" ";s=$r;[ $N -eq 0 ]&& z=_;[ $S -lt $r ]&& s=$S
- S=$[S-s];t=$[r-s];v=$[s/2];w=$[s-v];r=$[r+2]
- o=$n`f $N " "`$b`f $v x;f $t " ";f $w x`/$o$b$n`f $N " "`/`f $w "$z";f $t x;f $v "$z"`$b
- done;f $r _;echo -e "${o//\\//}"
- Input Integer: 10
- When were you born? 23-May-1974
- _____________________
- /
- /
- /
- /
- /
- /
- /
- x xx/
- xxx/
- x/
- /
- /
- / xx
- /xxxxxxx
- /xxxxxxxxx
- /xxxxxxxxxxx
- /xxxxxxxxxxxxx
- /xxxxxxxxxxxxxxx
- /xxxxxxxxxxxxxxxxx
- /xxxxxxxxxxxxxxxxxxx
- public class M{public static void main(String[] a){int h=Integer.parseInt(a[0]);int s=(int)Math.ceil(h*h*Integer.parseInt(a[1])/100.);r(h,h-1,s,true);r(h,h-1,s,false);}static void r(int h,int c,int r,boolean t){if(c<0)return;int u=2*(h-c)-1;if(t&&c==h-1)p(2*h+1,0,'_','_',true,0,false);int z=r>=u?u:r;r-=z;if(t)r(h,c-1,r,true);p(u,z,t?'x':((c==0)?'_':' '),t?' ':'x',t,c,true);if(!t)r(h,c-1,r,false);}static void p(int s,int n,char o,char i,boolean t,int p,boolean d){int f=(s-n);int q=n/2+(!t&&(f%2==0)?1:0);int e=q+f;String z = "";int j;for(j=0;j<p+4;j++)z+=" ";if(d)z+=t?'\':'/';for(j=0;j<s;j++)z+=(j>=q&&j<e)?i:o;if(d)z+=t?'/':'\';System.out.println(z);}}
- <?$s=$argv[1];$x='str_pad';$w=$s*2-1;$o[]=$x('',$w+2,'_');
- $r=$s*ceil($w/2);$w=$r-($r*substr($argv[2],0,-1)/100);$p=0;
- $c=-1;while($s){$k=$s--*2-1;$f=$x($x('',min($k,$w),' '),$k,'x',2);
- $g=$x($x('',min($k,$w),'x'),$k,' ',2);$w-=$k;$o[]=$x('',$p)."\$f/";
- $b[]=$x('',$p++)."/$g\";}$b[0]=str_replace(' ','_',$b[0]);
- krsort($b);echo implode("n",array_merge($o,$b));?>
- X,p=map(int,raw_input()[:-1].split())
- k=X*X;j=k*(100-p)/100
- n,u,x,f,b,s='n_x/ '
- S=list(x*k+s*j).pop;T=list(s*k+u*(2*X-j-1)+x*j).pop
- A=B=""
- for y in range(X):
- r=S();q=T()
- for i in range(X-y-1):r=S()+r+S();q+=T();q=T()+q
- A+=n+s*y+b+r+f;B=n+s*y+f+q+b+B
- print u+u*2*X+A+B
- public class M {public static void Main(){int h = Convert.ToInt32(Console.ReadLine());
- int s = Convert.ToInt32(h * h * Convert.ToInt32(Console.ReadLine()) / 100);r(h,h-1,s,true);
- r(h,h-1,s,false);Console.ReadLine();}static void r(int h, int c, int r, bool t){
- if(c<0) return;int u=2*(h-c)-1;if (t&&c==h-1)p(2*h+1,0,'_','_',true,0,false);
- int z=r>=u?u:r; r-=z;if (t)M.r(h,c-1,r,true); p(u,z,t?'x':((c==0)?'_':' '), t?' ':'x',t,c,true);
- if(!t)M.r(h,c-1,r,false);}static void p(int s, int n, char o, char i, bool t, int p, bool d)
- {int f=(s-n);int q=n/2+(!t&&(f%2==0)?1:0);int e=q+f;string z="";int j;for(j=0;j<p+4;j++) z+=" ";if(d)z+=t?'\':'/';
- for (j=0;j<s;j++) z+=(j>=q&&j<e)?i:o; if(d)z+=t?'/':'\';Console.WriteLine(z);}}
- n,p = $F.map{|i|i.to_i}
- r="n"
- y=''
- g,s,u,f,b=%w{x _ / \}
- $> << u*2*n+u+r # draw initial underbar line
- a=u
- c=100.0/n/n # amount of sand a single x represents
- e = 100.0 # percentage floor to indicate sand at this level
- n.times{ |i|
- d=2*n-1-2*i # number of spaces at this level
- e-= c*d # update percentage floor
- x = [((p - e)/c+0.5).to_i,d].min
- x = 0 if x<0
- w = x/2 # small half count
- z = x-w # big half count
- d = d-x # total padding count
- $> << s*i+b+g*w+s*d+g*z+f+r
- y=s*i+f+a*z+g*d+a*w+b+r+y
- a=s
- }
- $_=y
- m,p=$F.map{|i|i.to_i}
- q=m*m-m*m*(100-p)/100
- _,e,x,b,f=%w{_ x \ /}
- n="n"
- o=''
- r=1
- while m>0
- m-=1
- z=m>0?e:_
- s=q<r ?q:r
- q-=s
- t=r-s
- v=s/2
- w=s-v
- r=r+2
- o=n+e*m+b+x*v+e*t+x*w+f+o+n+e*m+f+z*w+x*t+z*v+b
- end
- $_=_*r+o
Add Comment
Please, Sign In to add comment