O’ZBEKISTO RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMUNIKATSIYALARNI RIVOJLANTIRISH VAZIRLIGI
MUXAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI 711-22 gurux Axborot xavfszligi fakulteti
Bajardi: Erkinov Jonibek
Tekshirdi: Gulyamova Dilfuza
6-variant
usul .
#include
#include
using namespace std;
struct Poezd {
string raqami;
string kelish_vaqti;
string ketish_vaqti;
string yo_nalish;
float masofasi;
};
int main() {
Poezd poezd1;
poezd1.raqami = "123A";
poezd1.kelish_vaqti = "2023/03/25 07:30";
poezd1.ketish_vaqti = "2023/03/25 11:45";
poezd1.yo_nalish = "Toshkent-Shovot";
poezd1.masofasi = 320.5;
cout << "Poezd raqami: " << poezd1.raqami << endl;
cout << "Kelish vaqti: " << poezd1.kelish_vaqti << endl;
cout << "Ketish vaqti: " << poezd1.ketish_vaqti << endl;
cout << "Yo'nalish: " << poezd1.yo_nalish << endl;
cout << "Masofasi: " << poezd1.masofasi << " km" << endl;
return 0;
}
usul .
#include
#include
using namespace std;
struct Poezd {
string raqami;
string kelish_vaqti;
string ketish_vaqti;
string yo_nalish;
float masofasi;
float tezligi;
};
int main() {
Poezd poezd1;
poezd1.raqami = "123A";
poezd1.kelish_vaqti = "2023/03/25 07:30";
poezd1.ketish_vaqti = "2023/03/25 11:45";
poezd1.yo_nalish = "Toshkent-Shovot";
poezd1.masofasi = 320.5;
poezd1.tezligi = poezd1.masofasi / ((stoi(poezd1.ketish_vaqti.substr(11,2))-stoi(poezd1.kelish_vaqti.substr(11,2)))*60);
cout << "Poezd raqami: " << poezd1.raqami << endl;
cout << "Kelish vaqti: " << poezd1.kelish_vaqti << endl;
cout << "Ketish vaqti: " << poezd1.ketish_vaqti << endl;
cout << "Yo'nalish: " << poezd1.yo_nalish << endl;
cout << "Masofasi: " << poezd1.masofasi << " km" << endl;
cout << "Tezligi: " << poezd1.tezligi << " km/soat" << endl;
return 0;
}
Do'stlaringiz bilan baham: |