Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- #include <cctype>
- class Counter
- {
- char* m_pStr;
- unsigned int m_nOwners;
- Counter* pNext;
- static Counter* Head;
- static unsigned int m_curCounters;
- Counter(char* str);
- public:
- static Counter* Init(char* str);
- static void Count();
- const char* Get_Str();
- static void Change_Register();
- static void AlphabetSort();
- static void Print_All();
- void Swap_Str(Counter& ref);
- void Del();
- void Add() { m_nOwners++; }
- ~Counter();
- };
- void Counter::Change_Register()
- {
- int n = m_curCounters;
- Counter* p = Head;
- while (n--)
- {
- int i = 0;
- while (i < strlen(p->m_pStr))
- {
- if (('A' <= p->m_pStr[i]) && (p->m_pStr[i] <= 'Z'))
- tolower(p->m_pStr[i]);
- if (('a' <= p->m_pStr[i]) && (p->m_pStr[i] <= 'z'))
- toupper(p->m_pStr[i]);
- i++;
- }
- if (n != 0) p = p->pNext;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement