Advertisement
Guest User

Untitled

a guest
Oct 17th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. //EXERCISE 2
  2. //main.cpp
  3.  
  4. #include <iostream>
  5. using namespace std;
  6.  
  7. void sortArray(char array[]);
  8.  
  9. int main(int argc, char** argv)
  10. {
  11.     int s = 0;
  12.     cout << "insert size please:";
  13.     cin >> s;
  14.    
  15.     char a[s];
  16.    
  17.     cout << "put r for colour red, b for colour blue" << endl;
  18.     for(int i = 0; i < s; i++)
  19.     {
  20.         cout << "color " << i + 1 << " is: ";
  21.         cin >> a[i];
  22.         cout << endl;
  23.     }
  24.    
  25.     sortArray(a);
  26.    
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement