Results 1 to 2 of 2

Thread: - /++/

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date: Jun:2011
    Location: varna
    Posts: 23

    - /++/

    :
    :
    - ( ) / 30/ " " , , , , ,
    - / /
    - - 20
    - main() -



    Code:
    #include <iostream> 
    #include <cstdio> 
    #include <conio.h> 
    #include <cstdlib> 
    #include <cstring> 
    #include <fstream> 
    using namespace std; 
    
    #define N 30 //max broi ychastnichi 
    
     struct girl 
    { 
       char nomer[10]; 
       char ime[10]; 
       char family[10]; 
       int age; 
       float visochina; 
       float teglo; 
       char country[3]; 
    } ; 
     girl d[N]; 
     int top=0; 
    
    /*Prototipi na funkcii*/ 
    void load();//zarejdane ot fail 
    void save();//zapis na fail 
    void input();//Vuvejdane na danni 
    void disp(int i);//Izvejdane na danni 
    void list();//Spisuk s uchastnichki 
    void teen();//Uchastnichki do 20g 
    void youngest(girl d[N]);//Izvejda nai-mladata uchastnichka 
    void showgirl(girl d[N]);//Izvejda 1 uchastnichka po vuvedeni nomer i familiq 
    int menu();//izbor ot menu 
    
    
    
    void input() 
    {int i, n; 
       do 
       { 
               cout<<"\n Kakuv e broq na ychastnichkite: "; 
               cin>>n; 
       } 
       while (n<1||n>N); 
       fflush(stdin); 
       for(i=top;i<n;i++) 
       { 
               cout<<"\n Nomer: "; 
               cin>>d[i].nomer; 
               cout<<"\n Ime: "; 
               cin>>d[i].ime; 
               cout<<"\n Familiq: "; 
               cin>>d[i].family; 
               cout<<"\n Godini: "; 
               cin>>d[i].age; 
               cout<<"\n Visochina(cm): "; 
               cin>>d[i].visochina; 
               cout<<"\n Teglo(kg): "; 
               cin>>d[i].teglo; 
               cout<<"\n Durjava: "; 
               cin>>d[i].country; 
       } 
       top+=n; 
    } 
    
    void disp(int i) //izvejda 1 ychastnichka 
    { 
       cout<<"\n "<<d[i].nomer<<"\t"<<d[i].ime<<"\t"<<d[i].family<<"\t"<<d[i].age<<"\t"<<d[i].visochina<<"\t" 
               <<d[i].teglo<<"\t"<<d[i].country<<endl; 
    } 
    
    void list() //spisuk na ychasnitchkite 
    { 
       int i; 
       cout<<"\n Spisuk na ychastnichkite\n"; 
       for(i=0;i<top;i++) 
       disp(i);} 
    
    
    void teen() 
    { 
         int i; 
          cout<<"\n Spisuk na ychastnichki do 20 godini\n"; 
             for(i=0;i<top;i++) 
             {d[i].age*=1; 
               if(d[i].age<20) 
                       disp(i); 
             } 
    } 
    
    void youngest(girl d[N]) 
    
    { 
         girl max; int k; 
         max.age = d[0].age; 
         for (int i = 1;i < k ; i++) 
            if (d[i].age > max.age) 
             max = d[i]; 
               cout << "Nai-mladata uchastnichka e  "<< max.ime << max.family << max.age << max.visochina << max.teglo << max.country;} 
    
    void showgirl(girl d[N]) 
    
    { 
         char nomer[10];char family[20];int i; 
             cout<<"Vuvedi nomer"<<endl; 
             cin>>nomer; 
             cout<<"Vuvedi familiq"<<endl; 
             cin>>family; 
                  if(!(strcmp(d[i].nomer,nomer))&&!(strcmp(d[i].family,family))) 
                  cout<<"Tursenata uchastnichka e "<<i; 
    } 
    
    int menu() 
    { 
       int ch; 
        
       cout<<"\n_______________MENU________________"; 
       cout<<"\n 1. Vuvedi broq na ychasnitchkite"; 
       cout<<"\n 2. Izvedi spisuk na vsichki ychasnitchki"; 
       cout<<"\n 3. Izvedi spisuk na ychastnichki do 20 godini"; 
       cout<<"\n 4. Izvedi uchastnichka po vuvedeni nomer i familiq"; 
       cout<<"\n 5. Izvedi nai-mlada uchastnichka"; 
       cout<<"\n 6. Izhod"; 
       do 
       { 
               cout<<"\n Izbor: "; 
               cin>>ch; 
       } 
       while(ch<1||ch>7); 
               return(ch); 
    } 
    int main() 
    { 
       int i; 
        
      
       do 
       { 
               i=menu(); 
               switch(i) 
               { 
               case 1: input();break; 
               case 2: list();break; 
               case 3: teen();break; 
               case 4: showgirl(d);break; 
               case 5: youngest(d);break; 
      
    
               } 
       } 
                       while(i!=6); 
    return 0; 
    }
    showgirl youngest- , , , -
    Click image for larger version. 

Name:	5578518E.jpg 
Views:	37 
Size:	4.7 KB 
ID:	58317
    - ,

  2. #2
    System.gc()'s Avatar
    Join Date: Apr:2007
    Location: back in time
    Posts: 1,075
    :

    - youngest , ; loop- ;
    - youngest - - . , , , .
    UD3R|Q9550+1283|4x2 G.Skill@1066|MX500+1002FAEX+640AAKS+ST31 60|RX580-8GB|1841BLT|SS-760XP|Define7|z24i|Edifier S350DB
    geniusloci: ) ; ) ; ) ? nope|r.i.p.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Copyright © 1999-2011 . .
iskamPC.com | mobility.BG | Bloody's Techblog | | 3D Vision Blog |