Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <conio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <fstream>
- #include <locale>
- #define N 30 //max broj ychastnichi
- using namespace std;
- void disp(int i);
- void input();
- void list();
- void teen();
- void load();
- int menu();
- typedef struct
- {
- char nomer[10];
- char ime[10];
- char family[10];
- int age;
- float visochina;
- float teglo;
- char country[3];
- }girl;
- int main(){
- int i;
- cout << "\n Зареждане от файл\n";
- load();
- do
- {
- i = menu();
- switch (i)
- {
- case 1: input(); break;
- case 2: list(); break;
- case 3: teen(); break;
- }
- } while (i != 4);
- return 0;
- }
- girl d[N];
- int top = 0;
- float height;
- float weight;
- void input(){
- int i, n;
- do
- {
- cout << "\n Какъв е броят на участничките: ";
- cin >> n;
- } while (n<1 || n>N);
- fflush(stdin);
- for (i = top; i < n; i++)
- {
- cout << "\n Номер: ";
- cin >> d[N].nomer;
- cout << "\n Име: ";
- cin >> d[N].ime;
- cout << "\n Фамилия: ";
- cin >> d[N].family;
- cout << "\n Години: ";
- cin >> d[N].age;
- cout << "\n Височина(В см): ";
- cin >> d[N].visochina;
- cout << "\n Тегло(В кг): ";
- cin >> d[N].teglo;
- cout << "\n Държава: ";
- cin >> d[N].country;
- }
- top += n;
- }
- void disp(int i){
- cout << "\n " << d[N].nomer << "\t" << d[N].ime << "\t" << d[N].family << "\t" << d[N].age << "\t" << d[N].visochina << "\t"
- << d[N].teglo << "\t" << d[N].country << endl;
- }
- void list(){ //Списък на участничките
- int i;
- cout << "\n Списък на участничките\n";
- for (i = 0; i<top; i++)
- disp(i);
- }
- void teen(){
- int i;
- cout << "\n Списък на участничките до 20 години\n";
- for (i = 0; i < top; i++)
- {
- d[N].age *= 1;
- if (d[N].age<20)
- disp(i);
- }
- }
- void load(){
- FILE *fp;
- }
- int menu(){
- int ch;
- cout << "\n_______________МИС СВЯТ_____________________";
- cout << "\n 1. Въведи броя на участничките";
- cout << "\n 2. Изведи списък на всички участнички";
- cout << "\n 3. Изведи списък на всички участнички до 20 години";
- cout << "\n 4. Изход";
- do
- {
- cout << "\n Избор: ";
- cin >> ch;
- } while (ch<1 || ch>4);
- return(ch);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement