Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <windows.h>
- #define ll long long
- #define all(x) x.begin(), x.end()
- #define sz(x) x.size()
- #define loop(i, q, x) for(int i = q; i < x; i++)
- //#define loop(i,j, x) for(int i = j; i < x; i++)
- #define DEBUG 1
- using namespace std;
- struct p{
- double x, y;
- };
- void b1(){
- string s;
- cin >> s;
- string s1 = s.substr(4, 3) + '.' +s.substr(0, 3);
- cout << s1;
- }
- void b3(){
- p p1, p2;
- cin >> p1.x >> p1.y >> p2.x >> p2.y;
- double k = (p2.y-p1.y)/(p2.x-p1.x);
- double b = (p2.x*p1.y-p2.y*p1.x)/(p2.x-p1.x);
- cout << format("y = {}x + {}", k, b) << endl;
- // cout << p2.y-p1.y << " " << p2.x-p1.x;
- }
- void b4(){
- string s;
- cin >> s;
- bool t = false;
- int c = 0;
- loop(i, 0, sz(s)){
- if(c < 4 && t){
- cout << s[i] << " ";
- }
- if(s[i] == ','){
- t = true;
- }
- c+=t;
- }
- }
- void b5(){
- double h, m;
- cin >> h >> m;
- double degperh = 360/12;
- cout << "Hours" << setw(15) << "Minutes" << setw(15) << "angle(deg)\n";
- cout << h << setw(15) << m << setw(15) << degperh*(h + m/60);
- }
- void b6(){
- ll x;
- cin >> x;
- vector<ll> dp(x+1,10000000);
- dp[0] = 0;
- vector<ll> a = {10, 5, 2, 1};
- loop(i, 1, x+1){
- for(auto q : a){
- if(i-q >= 0){
- dp[i] = min(dp[i], dp[i-q]+1);
- }
- }
- }
- cout << dp[x];
- }
- void b7(){
- double x, y, z;
- cin >> x >> y >> z;
- double cosx = acos(x/(sqrt(x*x + y*y + z*z)));
- double cosy = acos(y/(sqrt(x*x + y*y + z*z)));
- double cosz = acos(z/(sqrt(x*x + y*y + z*z)));
- }
- void b8(){
- ll h, m, s;
- cin >> h >> m >> s;
- cout << h*60*60 + m * 60 + s;
- }
- void b9(){ // ?????
- ll s;
- cin >> s;
- ll h = s/60/60;
- s-= h*60*60;
- ll min = s/60;
- s-= min*60;
- ll sec = s;
- cout << "Часы" << setw(15) << "Минуты" << setw(15) << "Секунды" << endl;
- cout << h << setw(15) << min << setw(15) << sec << endl;
- }
- void b10(){
- double a, b, c;
- cin >> a >> b >> c;
- // double metres =
- // 1 дюйм = 2.54 cm
- // 12 дюймов = фут
- // 3 фута = 1 ярд
- double acm = a*3*12*2.54, adec = acm*10, amet = adec*10; // ярды
- double bcm = b*12*2.54, bdec = bcm*10, bmet = bdec*10; // футы
- double ccm = c*2.54, cdec = ccm*10, cmet = cdec*10; // дюймы
- double cm = 100;
- double metres = cm/100;
- double yard = cm/2.54/12/3, foot = cm/2.54/12, inch =cm/2.54;
- // cout << foot;
- // cout << 2.54*;
- cout << "Yard " << setw(15) << "Foot " << setw(15) << "Inch\n";
- cout << setprecision(5) <<yard << setw(15) << foot << setw(15) << inch;
- }
- int main() {
- // SetConsoleOutputCP(CP_UTF8);
- // if (setlocale(LC_ALL, "") == NULL) {
- // puts("Unable to set locale");
- // }
- SetConsoleCP(1251);
- SetConsoleOutputCP(1251);
- // cout << "абс\n";
- #ifdef DEBUG
- freopen("text.txt", "r", stdin);
- #endif
- b9();
- return 0;
- }
Advertisement