Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static string RikiuotaEilutė(string rezultatuEilute)
- {
- string rezas = "";
- char rikiuota=' ';
- string alfabetas = "aąbcčdeęėfghiįyjklmnoprsštuųūvzž";
- char[] rezultatass = rezultatuEilute.ToCharArray();
- for (int i = 0; i < rezultatass.Length-1; i++)
- {
- for(int j=i+1; j<rezultatass.Length; j++)
- {
- if (alfabetas.IndexOf(rezultatass[i]) > alfabetas.IndexOf(rezultatass[j]))
- {
- if (alfabetas.IndexOf(rezultatass[i]) != -1 && alfabetas.IndexOf(rezultatass[j]) != -1)
- {
- rikiuota = rezultatass[i];
- rezultatass[i] = rezultatass[j];
- rezultatass[j] =rikiuota;
- }
- }
- }
- }
- for (int i = 0; i < rezultatass.Length; i++)
- rezas += rezultatass[i];
- return rezas;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement