Untitled
unknown
plain_text
2 years ago
994 B
2
Indexable
#include <iostream> #include <string> #include <cmath> using namespace std; struct timee { int h; int m; int s; }; int main() { timee first; cout << "vvedite pervoe vremya cheres probel\n"; cin >> first.h >> first.m >> first.s; cout << "pervoe vremya - " << first.h * 3600 + first.m * 60 + first.s << " v sec\n"; timee second; cout << "vvedite vtoroe vremya cheres probel\n"; cin >> second.h >> second.m >> second.s; cout << "vtoroe vremya - " << second.h * 3600 + second.m * 60 + second.s << " v sec\n"; timee third; third.h = abs(((first.h * 3600 + first.m * 60 + first.s) - (second.h * 3600 + second.m * 60 + second.s)) / 3600); third.m = abs((((first.h * 3600 + first.m * 60 + first.s) - (second.h * 3600 + second.m * 60 + second.s)) % 3600) / 60); third.s = abs((((first.h * 3600 + first.m * 60 + first.s) - (second.h * 3600 + second.m * 60 + second.s)) % 3600) % 60); cout << "rasnica - " << third.h << " " << third.m << ' ' << third.s; }
Editor is loading...