Advertisement
TAHMID37

Tahmid 237

Jul 12th, 2020
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. /*  TAHMID RAHMAN
  2.     DAMIAN FOREVER
  3.      MATH LOVER
  4.     NEVER GIVE UP
  5. */
  6. #include<bits/stdc++.h>
  7. using namespace std;
  8. #define pi acos(-1.0)
  9. #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
  10. #define ll long long
  11. #define pb push_back
  12. #define fi first
  13. #define se second
  14. #define in insert
  15. #define mp make_pair
  16. #define GCD(a,b) __gcd(a,b);
  17. #define endl "\n"
  18. #define FRU freopen("out.txt","w",stdout)
  19. #define FRO freopen("in.txt","r",stdin)
  20. #define INFLL 9223372036854775807
  21. #define debug 0
  22. #define MAXN   100001
  23. #define ar array
  24. const int mxN=2e5;
  25. const int MOD=1e9+7;
  26. bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);}
  27. //Don't hesitate to ask me if you don't understand my code.......Happy coding,Tahmid...;
  28.  
  29.  struct names{
  30.  
  31.    string first;
  32.    string middle;
  33.    string last;
  34.  
  35. };
  36.  
  37.  struct team{
  38.  
  39.   names name;
  40.   int roll;
  41.   string email;
  42. };
  43. struct node
  44. {
  45.     team x;
  46.     struct node*next;
  47. };
  48. struct node* head=NULL;
  49. void in(string first,string middle,string last,int roll ,string email)
  50. {
  51.     struct node *temp=(struct node*)malloc(sizeof(struct node));
  52.     temp->x.name.first=first;
  53.     temp->x.name.middle=middle;
  54.     temp->x.name.last=last;
  55.     temp->x.roll=roll;
  56.     temp->x.email=email;
  57.     temp->next=NULL;
  58.     if(head==NULL)
  59.     {
  60.         head=temp;
  61.     }
  62.     else
  63.     {
  64.         struct node* p=head;
  65.         while(p->next!=NULL)
  66.         {
  67.             p=p->next;
  68.         }
  69.         p->next=temp;
  70.     }
  71.  
  72. }
  73. void print()
  74. {
  75.     struct node* ptr=head;
  76.     while(ptr!=NULL)
  77.     {
  78.         cout<<"NAME:"<<ptr->x.name.first<<" "<<ptr->x.name.middle<<" "<<ptr->x.name.last<<endl;
  79.         cout<<"ROLL:"<<ptr->x.roll<<endl;
  80.         cout<<"EMAIL:"<<ptr->x.email<<endl;
  81.         cout<<endl;
  82.         ptr=ptr->next;
  83.     }
  84. }
  85.  
  86. int main()
  87. {
  88.  
  89.    in("Tahmid","Rahman","Rifat",37,"x.gmail.com");
  90.    in("Kawsar","Ahmed","siam",2,"a.gmail.com ");
  91.    print();
  92.  
  93.  
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement