Tranvick

Буквы

Jun 18th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     char s[100];
  7.     int a[26];
  8.     cin.getline(s, 100);
  9.     _asm {
  10.  
  11.         lea esi, a
  12.         mov ecx, 26
  13. _loop:
  14.         mov dword ptr [esi], 0
  15.         add esi, 4
  16.         loop _loop
  17.  
  18.         lea esi, s
  19.         xor ecx, ecx
  20. _loop1:
  21.         cmp byte ptr [esi], 0
  22.         je _end
  23.         mov cl, byte ptr [esi]
  24.         sub cl, 'a'
  25.         inc a[ecx * 4]
  26.         inc esi
  27.         jmp _loop1
  28. _end:
  29.     }
  30.     for (int i = 0; i < 26; ++i)
  31.         cout << (char)('a' + i) << " " << a[i] << endl;
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment