Advertisement
Guest User

Untitled

a guest
Jan 8th, 2012
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.99 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. struct nyul{
  4.     char n[21];
  5.     int b;
  6.     char m[21];
  7.     char f[21];
  8. };
  9.  
  10. int main(){
  11.     struct nyul tomb[100];
  12.     char input[101];
  13.     int i=0, j=0, z=0, l=0;
  14.     char egykar;
  15.        
  16.     while(input[0] != '*'){
  17.         printf("%d. ", i);
  18.         scanf("%s", input);
  19.    
  20.         while(input[j] != '\n'){
  21.             if(input[j]=='N'){
  22.                 z=j+2;
  23.                 while(input[z] != ' '){
  24.                     egykar=input[z];
  25.                     tomb[i].n[z]=egykar;
  26.                     z++;
  27.                 }
  28.        
  29.             }
  30.        
  31.             if(input[j]=='B'){
  32.                 tomb[i].b=input[j]-'A';
  33.             }
  34.    
  35.             if(input[j]=='M'){
  36.                 z=j+2;
  37.                 while(input[z] != ' '){
  38.                     egykar=input[z];
  39.                     tomb[i].m[z]=egykar;
  40.                     z++;
  41.                 }
  42.        
  43.             }      
  44.    
  45.             if(input[j]=='F'){
  46.                 z=j+2;
  47.                 while(input[z] != ' '){
  48.                     egykar=input[z];
  49.                     tomb[i].f[z]=egykar;
  50.                     z++;
  51.                 }          
  52.        
  53.             }          
  54.        
  55.             j++;
  56.         }
  57.         i++;
  58.     }
  59.    
  60.     for(l=0;l<j;l++){
  61.         printf("%s\n", tomb[l].n);
  62.         printf("%d\n", tomb[l].b);
  63.         printf("%s\n", tomb[l].m);
  64.         printf("%s\n", tomb[l].f);
  65.     }
  66.    
  67.  
  68.     return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement