SHARE
TWEET

Untitled

Radoan_Ahmed Sep 22nd, 2019 81 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<stdio.h>
  2. typedef struct st_info
  3. {
  4.     char name[50];
  5.     int id;
  6.     int semi;
  7.     int cors;
  8.  
  9. } info;
  10. int main()
  11. {
  12.     info data[5];
  13.     int i;
  14.     for(i=0; i<5; i++)
  15.     {
  16.         scanf("%[^\n]s",data[i].name);
  17.         scanf("%d %d %d",&data[i].id,&data[i].semi,&data[i].cors);
  18.     }
  19.     for(i=0; i<5; i++)
  20.     {
  21.         if(data[0].semi<data[i].semi)
  22.         {
  23.             data[0].semi=data[i].semi;
  24.         }
  25.     }
  26.     for(i=0; i<5; i++)
  27.     {
  28.         if(data[0].semi==data[i].semi)
  29.         {
  30.             printf("%s\n",data[i].name);
  31.             printf("%d\n",data[i].id);
  32.             printf("%d\n",data[i].semi);
  33.             printf("%d\n",data[i].cors);
  34.         }
  35.     }
  36.     return 0;
  37.  
  38. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top