,   CyberForum.ru

- C++


 
C++ http://www.cyberforum.ru/cpp-beginners/thread37071.html
: , ( 1 ) ? #include<stdio.h> #include<conio.h> #define LEN 81 #define NROWS 1 int main() { FILE *f; FILE *o; o=fopen("newtext.txt", "w");
C++ ... pascal c++. ... Program Kurs; uses crt,graph; type Dim=array of byte; DimPtr=^Dim; var Wx,Wy,col,x1,i :integer; DirPos,ImageFile,c :string; driv,mode,x,y :integer; seektiff :longint; http://www.cyberforum.ru/cpp-beginners/thread37060.html
C++
#include <iostream.h> #include <fstream.h> #include <stdlib.h> #include <windows.h> #include <conio.h> int AtoR(int);// int RtoA(char,char); void main()
Borland C. C++
- , , , : , , , , , . ,...
C++ http://www.cyberforum.ru/cpp-beginners/thread37048.html
, n , : 1) ; 2) , , , .
C++ 1) , n , : 1. . 2. , . . 2) , n , : 1. . 2....

Neogen
2 / 2 / 0
: 23.04.2009
: 24
28.05.2009, 21:19
? C++Builder 6 .

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
//---------------------------------------------------------------------------
 
#pragma hdrstop
#include <stdio.h>
#include <iostream.h>
#include <conio.h>
#include <string.h>
struct student        // Ø*áëî* ñòðóêòóðû
{
char name[20];          // èìÿ
char fam[30];          // ô*ìèëèÿ
int year;              // âîçð*ñò
int mark[5];           // îöå*êè
int average;           // Ñóìì* á*ëîâ
};
//---------------------------------------------------------------------------
 
#pragma argsused
int main(int argc, char* argv[])
{
student students[30];      // Ì*ññèâ ä***ûõ ïî ãðóïïå
student buffer;          // Äîïîë*èòåëü**ÿ ñòðóêòóð*
int records;          // Êîëè÷åñòâî ñòóäå*òîâ â ãðóïïå
int i, j ;
student mass[30];        // Âñïîìîã*òåëü*ûå ïåðåìå**ûå
records = 0 ;      // Ñ**÷*ë* ç*ïèñåé *åò
do        // Ç*ïîë*ÿåì ì*ññèâ ñòðóêòóð
{ cout <<  "Studen ¹ " << records+1 << endl;
cout <<  "Enter  family";  fflush(stdin) ;
cin >> students [records].fam;
cout <<  "Enter name  ";
cin >> students [records].name;
cout <<  "Enter age ";
cin >> students [records].year;
for(i = 0; i < 5; i++)
{ cout << "Enter an estimation on examination ¹  " <<i+1 <<endl;
cin >> students[records].mark[i];
}
records++;
cout << "To stop work? [1/0]  ";
cin >> i;
}     while(i) ;
for(i = 0; i < records; i++)         // Ïîäñ÷èòûâ*åò ñóììó á*ëëîâ
{   students [ i ].average = 0;
for (j=0;  j < 5; j++)
students[i].average += students[i].mark[j ];
}
for (i = 0; i < records-1; i++)       // ñîðòèðóåò
for (j = i; j < records; j++)          //     ïî ñóììå á*ëëîâ
if (students[i].average > students[j].average)
{     buffer = mass[i];     // Ïåðåñò**îâê* ýëåìå*òîâ
mass[i] = mass[j];         // ñòðóêòóðû, îñîáå**îñòü
mass[j] = buffer;         // ÿçûê* C/C++
}
for (i = 0; i < records; i++)     // Âûâîäèì ðåçóëüò*ò
{ cout << "\n Student " << students[i].name  <<  "\t" << students [i].fam ;
cout << " Age " <<  students [i].year;
cout << " Mean score" <<  students[i].average;
}
int k=0;
for ( int i=0; i<30; i++)
if ((!strcmp(students[i].name,"Natalya"))||(!strcmp(students[i].name,"Vladimir"))||(!strcmp(students[i].name,"Roman")))
        {
        k++;
        };
        printf("%d",k);
return 0;
 
}
//---------------------------------------------------------------------------
///CartmanRules )
 
- , ,
-
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
@Mail.ru