Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <string.h>
- #include <conio.h>
- using namespace std;
- void main()
- {
- unsigned int z;
- char name[64];
- int a,b,c,d,e,f;
- char g[64];
- struct dannye{
- int date;
- int month;
- int year;
- char place[10];
- int hours;
- int minutes;
- int freeplaces;
- }mstud;
- cout<<"vvedite date, month, year"<<endl;
- cin>>mstud.date;
- cin>>mstud.month;
- cin>>mstud.year;
- cout<<"Insert time"<<endl;
- cin>>mstud.hours;
- cin>>mstud.minutes;
- cout<<"Insert freeplaces"<<endl;
- cin>>mstud.freeplaces;
- cout<<"vvedite place"<<endl;
- cin>>name;
- for (z=0; z<strlen(name); z++)
- {
- mstud.place[z] = name[z];
- }
- mstud.place[z] = '\0';
- cout<<"zarezerv bilet: vvedite date, month, year"<<endl;
- cin>>a;
- cin>>b;
- cin>>c;
- cout<<"Insert time"<<endl;
- cin>>d;
- cin>>e;
- cout<<"vvedite freeplaces"<<endl;
- cin>>f;
- cout<<"vvedite place"<<endl;
- cin>>g;
- if((mstud.date>=a) && (mstud.month==b) && (mstud.year==c) && (mstud.hours>=d) && (mstud.minutes>=e) && (mstud.freeplaces<=f) && (strcmp(mstud.place, g)==0))
- {
- cout<<mstud.date<<"."<<mstud.month<<"."<<mstud.year<<"."<<mstud.hours<<"."<<mstud.minutes<<endl;
- cout<<mstud.place;
- }
- else
- {
- cout<<"You can't buy tickets"<<endl;
- }
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement