,   CyberForum.ru

++


 
qwertyk26
: n/a
#1

- C++

14.05.2012, 07:11. 214. 1
( )

.
!
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
int r = StrICmp(Name, right.Name);
    return r ? r < 0 : strcmp(Phone, right.Phone) < 0;
  }
};
 
//⥥ä***ï ª*¨£*
TAbonent Abonents[] = {
    {"&#129;*Ž? . .", "*ŽŒŽŒŽœ*ˆ, 5-215", "665395"},
    {"&#129;Ž?Ÿ . .", "˜ŒŸ*ŽƒŽ, 7-149", "665396"},
    {"Œˆ?Ž ?. .", "*ŽŒŽŒŽœ*ˆ, 2-50", "665397"},
    {"?*Ž . .", "Œ? ?*?, 6-261", "665398"},
    {"?ƒ?Ž&#141;Ž? . &#141;.", "9 Œ?Ÿ, 15-146", "665399"},
    {"&#129;Ž&#144;ˆ&#141;*Ž . ˆ.", "*ŽŒŽŒŽœ*ˆ, 5-63", "665400"},
    {"*ˆˆ? . .", "9 Œ?Ÿ, 15-258", "665401"},
    {"Œ?&#144;ˆŽ? Œ. *.", "˜ŒŸ*ŽƒŽ, 7-151", "665402"},
    {"&#141;œ*Ž? . ž.", "Œ? ?*?, 2-171", "665403"},
    {"&#143;?&#141;ž* . .", "9 Œ?Ÿ, 43-134", "665404"},
    {"&#143;Ž&#144;&#141;Ÿƒˆ&#141;? &#141;. ?.", "9 Œ?Ÿ, 12-61", "665405"},
    {"&#143;ŽŸ&#144;Ž? . ?.", "*ŽŒŽŒŽœ*ˆ, 2-7", "665406"},
    {"*ŽŽ*?Ÿ . ?.", "Œ? ?*?, 20-77", "665407"},
    {"ƒ&#141;?ž* . ?.", "9 Œ?Ÿ, 41-73", "665408"},
    {"&#144;?&#141;Ž &#141;. ?.", "9 Œ?Ÿ, 21-32", "665409"},
    {"ƒŽ&#144;&#129;&#141;Ž? . &#141;.", "9 Œ?Ÿ, 47-37", "665410"},
    {"*Ž?*ˆ . .", "9 Œ?Ÿ, 33-11", "665411"},
    {"ŽŒŽ? . ?.", "*ŽŒŽŒŽœ*ˆ, 7-96", "665412"},
    {"?ˆŽ*?Ÿ ?. .", "*ŽŒŽŒŽœ*ˆ, 3-149", "665413"},
    {"˜ˆ˜*ˆ&#144; . .", "*ŽŒŽŒŽœ*ˆ, 5-77", "665414"},
    {"&#143;?*ˆ&#141;? . &#143;.", "Œ? ?*?, 6-145", "665415"},
    {"&#143;?Ž&#141;ˆ*Ž &#141;. .", "9 Œ?Ÿ, 15-150", "665416"},
    {"ŽŒŽ&#144;Ž*?Ÿ &#157;. &#141;.", "*ŽŒŽŒŽœ*ˆ, 5-113", "665417"},
    {"ƒŽ&#144;Ÿ? Ž. ?.", "Œ? ?*?, 4-20", "665418"},
    {"&#141;ˆ*ˆˆ&#141;? . ˆ.", "Œ? ?*?, 2-147", "665419"},
    {"&#144;ž*Ž? . .", "9 Œ?Ÿ, 15-302", "665420"},
    {"*Ž˜Ÿ* &#141;. Œ.", "Œ? ?*?, 4-153", "665421"},
    {"Œ?&#144;&#141;*Ž . ˆ.", "Œ? ?*?, 2-84", "665422"},
    {"&#129;Ÿ? . &#141;.", "Œ? ?*?, 4-152", "665423"}
};
 
//¢ë¢¨â ** *ª*** ᯨ᪠*¡*¥*⢠¯ ¨*¥ªáã
void ShowAbonents(unsigned* index, unsigned count)
{
  for (unsigned i = 0; i < count; i++) {
    TAbonent& a = Abonents[index[i]];
    printf("%s, %s, %s\n", a.Phone, a.Name, a.Address);
  }
  puts("");
}
 
int main()
{
  unsigned count = sizeof(Abonents) / sizeof(*Abonents),
    *index = new unsigned[count],
    i;
  for (i = 0; i < count; i++)
    index[i] = i;
  ShowAbonents(index, count);
    unsigned j;
    int t = index[i];
    for (j = i; j && Abonents[t] < Abonents[index[j - 1]]; j--)
        index[j] = index[j - 1];
    index[j] = t;
  }
 
  ShowAbonents(index, count);
  delete [] index;
}
Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
14.05.2012, 07:11    
:

C++
2 C++
C++
? C++
C++
C++
C++
C++
C++
C++ - memmove
C++
C++



:
.
Sylar9
-20 / 55 / 2
: 04.09.2011
: 1,910
: 1
14.05.2012, 07:59     #2
)))
Yandex
14.05.2012, 07:59    

- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru