Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
g
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
//Microsoft (R) C/C++ Optimizing Compiler Version 19.00.23506 for x64 #include<iostream> #include<string> #include<cstring> #include<time.h> #include<iomanip> #include<algorithm> #include<stdlib.h> using namespace std; int main() { string str2= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; string str3= "1011121314151617181920212223242526272829303132333435"; string str1; string res = ""; cout << "Enter word you want encrypt" << endl; getline(cin, str1); for (int i = 0; i < str1.length(); i++) { if (str1[i] == 'a'|| str1[i] == 'A') res += str2.replace(0, 52, str3, 0, 2); else if (str1[i] == 'b'|| str1[i] == 'B') res += str2.replace(0, 52, str3, 2, 2); else if (str1[i] == 'c'|| str1[i] == 'C') res += str2.replace(0, 52, str3, 4, 2); else if (str1[i] == 'd'|| str1[i] == 'D') res += str2.replace(0, 52, str3, 6, 2); else if (str1[i] == 'e'|| str1[i] == 'E') res += str2.replace(0, 52, str3, 8, 2); else if (str1[i] == 'f'|| str1[i] == 'F') res += str2.replace(0, 52, str3, 10, 2); else if (str1[i] == 'g'|| str1[i] == 'G') res += str2.replace(0, 52, str3, 12, 2); else if (str1[i] == 'h'|| str1[i] == 'H') res += str2.replace(0, 52, str3, 14, 2); else if (str1[i] == 'i'|| str1[i] == 'I') res += str2.replace(0, 52, str3, 16, 2); else if (str1[i] == 'j'|| str1[i] == 'J') res += str2.replace(0, 52, str3, 18, 2); else if (str1[i] == 'k'|| str1[i] == 'K') res += str2.replace(0, 52, str3, 20, 2); else if (str1[i] == 'l'|| str1[i] == 'L') res += str2.replace(0, 52, str3, 22, 2); else if (str1[i] == 'm'|| str1[i] == 'M') res += str2.replace(0, 52, str3, 24, 2); else if (str1[i] == 'n'|| str1[i] == 'N') res += str2.replace(0, 52, str3, 26, 2); else if (str1[i] == 'o'|| str1[i] == 'O') res += str2.replace(0, 52, str3, 28, 2); else if (str1[i] == 'p'|| str1[i] == 'P') res += str2.replace(0, 52, str3, 30, 2); else if (str1[i] == 'q'|| str1[i] == 'Q') res += str2.replace(0, 52, str3, 32, 2); else if (str1[i] == 'r'|| str1[i] == 'R') res += str2.replace(0, 52, str3, 34, 2); else if (str1[i] == 's'|| str1[i] == 'S') res += str2.replace(0, 52, str3, 36, 2); else if (str1[i] == 't'|| str1[i] == 'T') res += str2.replace(0, 52, str3, 38, 2); else if (str1[i] == 'u'|| str1[i] == 'U') res += str2.replace(0, 52, str3, 40, 2); else if (str1[i] == 'v'|| str1[i] == 'V') res += str2.replace(0, 52, str3, 42, 2); else if (str1[i] == 'w'|| str1[i] == 'W') res += str2.replace(0, 52, str3, 44, 2); else if (str1[i] == 'x'|| str1[i] == 'X') res += str2.replace(0, 52, str3, 46, 2); else if (str1[i] == 'y'|| str1[i] == 'Y') res += str2.replace(0, 52, str3, 48, 2); else if (str1[i] == 'z'|| str1[i] == 'Z') res += str2.replace(0, 52, str3, 50, 2); } cout << res << endl; system("pause"); return 0; }
cl.exe
foo bar
Show compiler warnings
[
+
] Compiler args
[
-
]
Show input
Compilation time: 2 sec, absolute running time: 0,45 sec, absolute service time: 2,47 sec
edit mode
|
history
Enter word you want encrypt 152424111027 Press any key to continue . . .