- 01
 - 02
 - 03
 - 04
 - 05
 - 06
 - 07
 - 08
 - 09
 - 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
 - 75
 - 76
 - 77
 - 78
 - 79
 - 80
 - 81
 - 82
 - 83
 - 84
 - 85
 - 86
 - 87
 - 88
 - 89
 - 90
 - 91
 - 92
 - 93
 - 94
 - 95
 - 96
 - 97
 
                        #include <dir.h>//ДЛЯ ОПРЕДЕЛЕНИЯ mkdir(ИМЯ ПАПКИ)
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <alloc.h>
#include <string.h>
#include <iostream.h>
 int ndig(char x)
{if('0'<=x&&x<='9')return 0;else return 1;}
// СТРОКА ВЕДОМОСТИ ДЛЯ ОДНОГО СТУДЕНТА
 struct stud
{char fio[122];int b[9],ns
static int nc
,nd;
 void out(FILE*fo);stud(){fio[121]=0;}
stud(FILE*fi);
stud(stud&s){*this=s;}
}; //end of stud body
 int stud::nc=44;
 int stud::nd=5;
 stud::stud(FILE *fi)
{fscanf(fi,"%i ",&ns); fgets(fio,nc,fi);
for(int j=1;j<=nd;++j)fscanf(fi,"%i",&b[j]);}
 void stud::out(FILE*fo=stdout)
{fprintf(fo,"%3i ",ns);
fputs(fio,fo); for(int j=1;j<=nd;++j)
{if(b[j]>=0&&b[j]<6) fprintf(fo,"%3i",b[j]);
else fprintf(fo,"   ");}
fprintf(fo,"\n"); if ( fo==stdout) getch();
}//end of stud
//ВЕДОМОСТЬ ОДНОЙ ГРУППЫ
//("МАССИВ СТРОК" ДЛЯ ОТДЕЛЬНЫХ СТУДЕНТОВ)
 struct grup{ stud**st;//"МАССИВ СТУДЕНТОВ"
FILE*fi;char title[3][122]//"ШАПКА" ВЕДОМОСТИ
,sf[77];
int ms;//ЧИСЛО СТУДЕНТОВ
void nw();//ПАМЯТЬ ДЛЯ СТУДЕНТОВ
void out(char*sf); void out(FILE*fo);
grup(grup&g);grup(int fms){ms=fms; nw();}
grup(char*sf); grup&operator=(const grup&g);
void deg();~grup(){deg();} grup(); };
//end of grup body
 grup::grup(){ms=0;st=0;fi=0;
for(int j=0;j<3;++j)memset(title[j],0,122);}
 void grup::nw()
{st=new stud*[ms+1];
if(!st){cout<<"\nst=0  grup::nw()\n";exit(1);}
for(int j=0;j<=ms;++j)
{st[j]=new stud;
if(!st){cout<<"\nst[j]=0\n";exit(1);}
}}
 grup::grup(char*fsf)
{strcpy(sf,fsf); char s[77]="\n"; int j;
fi=fopen(sf,"rt");
if(!fi)
{cout<<"\n0)fi=0,sf="<<sf;getch();exit(1);}
ms=0; while(!feof(fi)){fgets(s,77,fi);++ms;}
ms-=3; fclose(fi); fi=fopen(sf,"rt");
if(!fi){cout<<"\nfi\n";exit(1);}
for(j=0;j<3;++j) fgets((title[j]),77,fi);
//ВВОД "СТУДЕНТОВ" ИЗ ФАЙЛА sf
nw();for(j=1;j<=ms;++j){stud stj(fi);*st[j]=stj;}
fclose(fi);
}
 grup&grup::operator=(const grup&g)
{if(this==&g)return*this; int j; this->deg();
fi=g.fi; strcpy(sf,g.sf); ms=g.ms;
nw(); for(j=0;j<=ms;++j)*st[j]=*g.st[j];
for(j=0;j<3;++j)strcpy(title[j],g.title[j]);
return*this;
}
 grup::grup(grup&g)
{for(int j=0;j<3;++j)strcpy(title[j],g.title[j]);
ms=g.ms; strcpy(sf,g.sf);
nw(); for(j=0;j<=ms;++j)*st[j]=*g.st[j];
}
 void grup::deg()
{if(st) {for(int j=0;j<=ms;++j)
if(st[j]){delete st[j];st[j]=0;}delete[]st;st=0;}
}
 void grup::out(FILE*fo=stdout)
{if(fo==stdout)cout<<'\n'; int j=0;
for(;j<3;j++) fputs(title[j],fo);
for(j=1;j<=ms;j++) st[j]->out(fo);
}
 void grup::out(char*sf)
{FILE*fo=fopen(sf,"wt");
if(!fo){cout<<"\nfo=0\n";exit(1);}
out(fo); fclose(fo);
} //end of grup
                                     
        
            Кусок кода с "базовыми классами" для курсовой работы в непоследнем университете Петербурга. Данные "классы" потом по заданию предлагается всячески расширять. 
А потом жалуемся, что студенты ничего не умеют. А кто ж их учит?