Advertisement
dllbridge

Untitled

Nov 3rd, 2022
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. #include <string.h>
  6.  
  7.  
  8.      int n = 0;
  9.      
  10.      
  11. char sz[33] = "abcdefghijklmnopqrstuvwxyz";
  12.  
  13. char sz1[9] = "zx",   // 649
  14.      sz2[9];
  15. ////////////////////////////////////////////////////////////
  16. int main()                                                //
  17. {
  18.    
  19.    cin >> sz1;
  20.    
  21.    for(int i  = 0; i  < 26; i ++)  
  22.    for(int i2 = 0; i2 < 26; i2++)
  23.    {
  24.        
  25.        if(i == i2) continue;
  26.        
  27.        n++;
  28.        
  29.        sz2[0] = sz[i ];
  30.        sz2[1] = sz[i2];        
  31.        if(strcmp(sz1, sz2) == 0) cout << n << endl;        
  32.    
  33.    }
  34.  
  35. }
  36.  
  37.  
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement