1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#include <iostream>
#include <deque>
using namespace std;
int main()
{
char iword[200];
string str_iword2;
int ilength=0;
cin.get(iword, sizeof(iword)); cin.ignore(1000,'\n');
char alfabet[]={'A', 'B', 'C', 'D','E','F', 'G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','X','Y','Z','a','b','c','c','d','e','f','g','h','i','j','k','0','l','m','n','o','p','q','r','s','t','u','v','x','y','z','0','1','2','3','4','5','6','7','8','9'};
deque<char>alfabetet(alfabet, alfabet+sizeof(alfabet));
str_iword2=iword;
ilength=str_iword2.length();
int k=0;
for(int i=0; i<ilength; i++){
if(iword[i]==alfabetet.at(k)){iword[i]=char(65+1);}
else if(iword[i]!=alfabetet.at(k)){k++; i=i-1;}
}
cout<<iword;
return 0;
}
| |