Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using namespace std;
- #include <iostream>
- #include <iomanip>
- int main()
- {
- char records = 2;
- char temp[3] = { 0 };
- char a[2][3] = { 0 };
- /*char test[2][3];*/
- cout << "\nEnter A0: ";
- cin.sync();
- cin.getline(a[0], 4);
- cin.sync();
- cout << endl;
- cout << "\nEnter A1: ";
- cin.sync();
- cin.getline(a[1], 4);
- cin.sync();
- cout << endl;
- /*cin >> test[0]
- >> test[1];*/
- for (int i = 0; i < 2; i++)
- {
- for (int j = 0; j < 2; j++)
- {
- if (strcmp(a[i], a[j]) > 0)
- {
- strcpy_s(temp, a[i]);
- strcpy_s(a[i], a[j]);
- strcpy_s(a[j], temp);
- }
- }
- }
- cout << a[0] << "\n" << a[1] << "\n" ;
- /*<< test << "\n"*/
- system("pause");
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement