Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* TAHMID RAHMAN
- DAMIAN FOREVER
- MATH LOVER
- NEVER GIVE UP
- */
- #include<bits/stdc++.h>
- using namespace std;
- #define pi acos(-1.0)
- #define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
- #define ll long long
- #define pb push_back
- #define fi first
- #define se second
- #define in insert
- #define mp make_pair
- #define GCD(a,b) __gcd(a,b);
- #define endl "\n"
- #define FRU freopen("out.txt","w",stdout)
- #define FRO freopen("in.txt","r",stdin)
- #define INFLL 9223372036854775807
- #define debug 0
- #define MAXN 100001
- #define ar array
- const int mxN=2e5;
- const int MOD=1e9+7;
- bool sortbysec(const pair<int,int> &a,const pair<int,int> &b){return (a.second < b.second);}
- //Don't hesitate to ask me if you don't understand my code.......Happy coding,Tahmid...;
- struct names{
- string first;
- string middle;
- string last;
- };
- struct team{
- names name;
- int roll;
- string email;
- };
- struct node
- {
- team x;
- struct node*next;
- };
- struct node* head=NULL;
- void in(string first,string middle,string last,int roll ,string email)
- {
- struct node *temp=(struct node*)malloc(sizeof(struct node));
- temp->x.name.first=first;
- temp->x.name.middle=middle;
- temp->x.name.last=last;
- temp->x.roll=roll;
- temp->x.email=email;
- temp->next=NULL;
- if(head==NULL)
- {
- head=temp;
- }
- else
- {
- struct node* p=head;
- while(p->next!=NULL)
- {
- p=p->next;
- }
- p->next=temp;
- }
- }
- void print()
- {
- struct node* ptr=head;
- while(ptr!=NULL)
- {
- cout<<"NAME:"<<ptr->x.name.first<<" "<<ptr->x.name.middle<<" "<<ptr->x.name.last<<endl;
- cout<<"ROLL:"<<ptr->x.roll<<endl;
- cout<<"EMAIL:"<<ptr->x.email<<endl;
- cout<<endl;
- ptr=ptr->next;
- }
- }
- int main()
- {
- in("Tahmid","Rahman","Rifat",37,"x.gmail.com");
- in("Kawsar","Ahmed","siam",2,"a.gmail.com ");
- print();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement