Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Hash(Prototipo)
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
//g++ 5.4.0 #include <iostream> #include <map> using namespace std; long long hashh(string entrada,int base,long long modulo){ long long suma=0; for(int i=0; i<entrada.size(); i++){ suma+=((suma%modulo)*(base%modulo)+entrada[i])%modulo; } return suma; } int main() { string entrada; long long Nueve=1000000007,Siete=1000000009, prueba; cin>>entrada; map<long long, string> hashes; prueba=hashh(entrada, 160,Nueve); hashes[hashh(entrada, 160,Nueve)]=entrada; cout<<"salida:"<<hashes[prueba]<<"\n"; cout << "Hello, world!\n"; }
g++
Show compiler warnings
[
+
] Compiler args
[
+
]
Show input
edit mode
|
history
|
discussion