paste bin
Author
Language
C++
Plain text
Accesslog
Action script
Ada
Apache
Arduino
Armasm
Autohotkey
Awk
Bash
Basic
Brainfuck
C
Clojure
Cmake
C#
css
D
Delphi
Dockerfile
Erlang
Fortran
F#
Gauss
Go
Gradle
Graphql
Groovy
Haskell
Ini
Java
JavaScript
json
Julia
Kotlin
Lasso
LaTeX
Leaf
lisp
llvm
Lua
Makefile
Markdown
Mathematica
Matlab
Nginx
Objective-C
Ocaml
Oxygene
Perl
PgSQL
php
Powershell
Processing
Profile
Properties
Puppet
Purebasic
Python
Q
QML
R
Ruby
Rust
Scala
Scheme
Scilab
Shell
Smalltalk
SQL
Swift
Typescript
VB.NET
VB Script
Verilog
Vim
Wasm
x86asm
Xml
Xquery
Yaml
source code:
#include <cstdio> int main(void) { char **pic; int R,C,i,j; int malicCount,p_x,p_y; scanf("%d%d",&R,&C); pic=new char* [R]; for(i=0;i<R;i++) pic[i]=new char [C]; for(i=0;i<R;i++) { getchar(); for(j=0;j<C;j++) scanf("%c",&pic[i][j]); } for(j=0;j<C;j++) { p_x=R; p_y=j; malicCount=0; for(i=R-1;i>=0;i--) { if(pic[i][j]=='a') { malicCount++; pic[i][j]='.'; } else if(pic[i][j]=='#') { for(int k=1;k<=malicCount;k++) pic[p_x-k][p_y]='a'; p_x=i; malicCount=0; } } for(int k=1;k<=malicCount;k++) pic[p_x-k][p_y]='a'; } for(i=0;i<R;i++) { for(j=0;j<C;j++) printf("%c",pic[i][j]); printf("\n"); } for(i=0;i<R;i++) delete [] pic[i]; delete [] pic; return 0; }
comment: