Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main ()
- {
- int count = 20, i=0, word=0 ;
- string s;
- getline(cin, s);
- for(i = 0; i < s.length()-1; i++)
- {
- if (s[i] >= 'A' && s[i] <= 'Z' || s[i] >= 'a' && s[i] <= 'z')
- word++;
- else
- {
- if (word < count)
- count = word;
- word = 0;
- }
- }
- for(i = 0; i < s.length(); i++)
- {
- if (s[i] >= 'A' && s[i] <= 'Z')
- s[i] = (((s[i] - 'A' - count + 26) % 26) + 'A');
- if (s[i] >= 'a' && s[i] <= 'z')
- s[i] = (((s[i] - 'a' - count + 26) % 26) + 'a');
- }
- for(i = 0; i < s.length(); i++)
- cout << s[i];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement