Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Last active December 27, 2015 19:29
Show Gist options
  • Save IuryAlves/7377368 to your computer and use it in GitHub Desktop.
Save IuryAlves/7377368 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(){
string nome("Texto #3");
string nova = "";
int i,aux,n,m;
cin >> n;
cin >> m;
for(i = 0; i < nome.size();i++){
if( ( (int)nome[i] >= 65 && (int)nome[i] <= 90) || ( (int)nome[i] >= 97 && (int)nome[i] <= 122 ) ){
aux = (int)nome[i] + 3;
nome[i] = (char)aux;
}
}
for(i = 0,aux= nome.size(); i < nome.size();i++){
nova[i] = nome[--aux];
}
for(i = nome.size()/2; i < nome.size(); i++){
aux = (int)nova[i] - 1;
nova[i] = (char)aux;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment