,   CyberForum.ru

++


 
DEADO
: n/a
#1

- C++

14.05.2013, 20:04. 188. 0
( )

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
67
68
69
70
71
72
73
74
//-----------------------------------------------------------------------------------------------------
#pragma hdrstop
//-----------------------------------------------------------------------------------------------------
#include <conio.h>      //áèáëèîòåê* ïîäêëþ÷å*èÿ ôó*êöèè getch()
#include <iostream.h> //áèáëèîòåê* äëÿ cin è cout
#include <malloc.h>    //áèáëèîòåê* äëÿ äè**ìè÷åñêîãî âûäåëå*èÿ ï*ìÿòè
#include <fstream.h>   //áèáëèîòåê* äëÿ ââîä*/âûâîä* â ô*éë
#include <windows.h> //áèáëèîòåê* èñïîëüçóåòñÿ â ôó*êöèè RUS
#include <math.h>       //áèáëèîòåê* ì*òåì*òè÷åñêèõ ôó*êöèé
#include <ctype.h>      // áèáëèîòåê* ïðîâåðêè ïðè**äëåæ*îñòè ñèìâîëîâ
#include <stdlib.h>      // áèáëèîòåê* *åêîòîðûõ ñò**ä*ðò*ûõ ôó*êöèé
#include <string.h>      // áèáëèîòåê* ôó*êöèé ð*áîòû ñî ñòðîê*ìè
//
char bufRus[256];
//-----------------------------------------------------------------------------------------------------
char* RUS(const char*text) //ôó*êöèÿ ïîääåðæêè ðóññêîãî ÿçûê*
{
CharToOem(text,bufRus);
return bufRus;
}
struct NOTE{
char NAME[20],
TELE[15];
unsigned BDAY[3];
};
//-----------------------------------------------------------------------------------------------------
#pragma argsused
int main()
{
const int k=4;
NOTE BNOTE[k], T;
int i,j;
char Number[15];
for(i=0;i<k;i++)
 {
A : printf("\nName? ");
cin>>(BNOTE[i].NAME);
if(strlen(BNOTE[i].NAME)==0) goto A;
printf("\nPhone number? ");
cin>>(BNOTE[i].TELE);
printf("\nBirthday (YYYY MM DD)? ");
for(j=0;j<3;j++)scanf("%u",&BNOTE[i].BDAY[j]);
 
 }
for(i=0;i<k;i++)
for(j=0;j<k-i-1;j++)
if((long)1000*BNOTE[j].BDAY[0]+50*BNOTE[j].BDAY[1]+BNOTE[j].BDAY[2]>
(long)1000*BNOTE[j+1].BDAY[0]+50*BNOTE[j+1].BDAY[1]+BNOTE[j+1].BDAY[2])
 {
 T=BNOTE[j];
 BNOTE[j]=BNOTE[j+1];
 BNOTE[j+1]=T;
 }
for(i=0;i<k;i++)
  {
printf("\nName: %s \nPhone number: %s \nBirthday: %u %u %u\n\n",
BNOTE[i].NAME, BNOTE[i].TELE,
BNOTE[i].BDAY[0],BNOTE[i].BDAY[1],BNOTE[i].BDAY[2]);
  }
printf("\nNumber for the seach? ");
 cin>>(Number);
 j=0;
for(i=0;i<k;i++)
if(!strcmp(Number,BNOTE[i].TELE))
  {
printf("\nName: %s \nPhone number: %s \nBirthday: %u %u %u\n\n",
BNOTE[i].NAME, BNOTE[i].TELE,
BNOTE[i].BDAY[0],BNOTE[i].BDAY[1],BNOTE[i].BDAY[2]);
j=1;
  }
if(!j)printf("\nNo such person!\n");
getch();
return 0;
 }





Similar
41792 / 34177 / 6122
: 12.04.2006
: 57,940
14.05.2013, 20:04    
:

C++
C++
v3.0 C++
! C++
, map-e C++
- C++
C++
C++
C++ -
( ) C++
C++
C++



:
.

: 05:14. GMT +3.
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru