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> #include <algorithm> using std::max; int main(void) { char seqA[4]="ABC",seqB[5]="BABC",seqG[7]="CCAABB"; char msg[102]; int i,N,countA=0,countB=0,countG=0,maxVal=0; scanf("%d",&N); scanf("%s",msg); for(i=0;i<N;i++) { countA+= msg[i]==seqA[i%3]; countB+= msg[i]==seqB[i%4]; countG+= msg[i]==seqG[i%6]; } maxVal=max(countA,max(countB,countG)); printf("%d\n",maxVal); if (countA==maxVal) printf("Adrian\n"); if (countB==maxVal) printf("Bruno\n"); if (countG==maxVal) printf("Goran\n"); return 0; }
comment: