|
//programmin by A. Najafzadeh -
Tuesday, March 07, 2006
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
void table();
class ff{
public:
char
name[21];
char
last_name[30];
float num;
ff *next;
} *first , *last;
int main()
{
int count = 0 ;
first = last = NULL;
table(); //calling table
function
while(count != 100)
//start of
while
{
ff *avali = new ff;
if(!avali)
{
cout<<'\n'<<"not
elocation unit";
getch();
exit(0);
}
avali->next = NULL;
if(first == NULL)
{
gotoxy(38,2); cout<<(count + 1);
first = last = avali;
gotoxy(1,4); cin>>avali->name;
gotoxy(10,4);
cin>>avali->last_name;
gotoxy(28,4); cin>>avali->num;
}
else
{
clrscr();
table();
gotoxy(38,2);
cout<<(count + 1);
last -> next = avali;
last = avali;
gotoxy(1,4);
cin>>avali->name;
gotoxy(10,4);
cin>>avali->last_name;
gotoxy(28,4);
cin>>avali->num;
}
count++;
}//end
of while
ff *dovomi = new ff;
if(!dovomi)
//if not
free memory
{
cout<<'\n'<<"not
elocation unit";
getch();
exit(0);
}
dovomi = first;
table();
int m = 4;
while(dovomi)
//start of
while
{
if(dovomi->num >= 17)
{
gotoxy(1,m);
cout<<dovomi->name;
gotoxy(10,m);
cout<<dovomi->last_name;
gotoxy(28,m);
cout<<dovomi->num;
m++;
}
dovomi = dovomi -> next;
if(m == 24)
{
m == 4;
cout<<"press any key to
see the naxt page";
getch();
}
}//end
of while
getch();
return 0;
}
///////////////////
void table started
void table()
{
clrscr();
cout<<"======================================\n";
cout<<"name last_name
nomreh\n";
cout<<"======================================\n";
} |