Advertisement
apl-mhd

HelfFulmat

Dec 22nd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.65 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstring>
  4. #include <cstdio>
  5. #include <vector>
  6. #include <algorithm>
  7. using namespace std;
  8.  
  9. int main(int argc, char **argv)
  10. {
  11.    
  12.     vector <char> number;
  13.    
  14.     int length, i;
  15.    
  16.     char equation[100];
  17.    
  18.     gets(equation);
  19.    
  20.    
  21.    
  22.     length= strlen(equation);
  23.    
  24. //  printf("%d",length);
  25.    
  26.     for(i=0;i<length; i+=2){
  27.        
  28.         number.push_back(equation[i]);
  29.        
  30.        
  31.        
  32.         }
  33.        
  34.         sort(number.begin(),number.end());
  35.        
  36.         for(i =0; i<number.size()-1; i++){
  37.            
  38.            
  39.             printf("%c+", number[i]);
  40.            
  41.            
  42.             }
  43.            
  44.             printf("%c", number[i]);
  45.        
  46.        
  47.         //printf("%d", number.size());
  48.    
  49.    
  50.     return 0;
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement