#include #include using namespace std; static const string charList = "abcdefghijklmnopqrstuvwxyz"; int main(){ string arrayofstrings[100]; string tempVar; srand(time(0)); // Rastgele olusturma for(int i = 0; i<100; i++){ arrayofstrings[i] = ""; for(int j = 0; j<(rand() % 7) + 3; j++){ arrayofstrings[i] += charList[rand() % 26]; } } // A'dan Z'ye for(int i = 0; i<99; i++){ for(int j=i+1;j<99;j++){ if(arrayofstrings[i] > arrayofstrings[j]){ tempVar = arrayofstrings[i]; arrayofstrings[i] = arrayofstrings[j]; arrayofstrings[j] = tempVar; } } cout << arrayofstrings[i] << endl; } // Z'den A'ya for(int i = 0; i<99; i++){ for(int j=i+1;j<99;j++){ if(arrayofstrings[i] < arrayofstrings[j]){ tempVar = arrayofstrings[i]; arrayofstrings[i] = arrayofstrings[j]; arrayofstrings[j] = tempVar; } } cout << arrayofstrings[i] << endl; } }