C++入门同步记录#4

/*#include<iostream>
using namespace std;
int main() {
    char a, b, c, dot, d;
    cin >> a >> b >> c >> dot >> d;
    cout << d << dot << c << b << a;
    return 0;
}*/
#include<cstdio>
int main() {
    char a, b, c, d;
    scanf("%c%c%c.%c", &a, &b, &c, &d);
    printf("%c.%c%c%c", d, c, b, a);
    return 0;
}

#include<cstdio>
using namespace std;
int main() {
    double t;
    int n;
    scanf("%lf%d", &t, &n);
    printf("%.3f\n%d", t / n, n * 2);
    return 0;
}

#include<cstdio>
using namespace std;
int main() {
    int a, b, t;
    scanf("%d %d", &a, &b);
    t = a; a = b, b = t;
    printf("%d %d", a, b);
    return 0;
}

/*#include<cstdio>
using namespace std;
int main() {
    int a, b, c, d;
    scanf("%d %d %d %d", &a, &b, &c, &d);
    int time1, time2, time3;
    time1 = a * 60 + b;
    time2 = c * 60 + d;
    time3 = time2 - time1;
    int h, m;
    h = time3 / 60;
    m = time3 % 60;
    printf("%d %d", h, m);
    return 0;
}*/
#include<cstdio>
using namespace std;
int main() {
    int a, b, c, d, e, f, delta;
    scanf("%d%d%d%d", &a, &b, &c, &d);
    delta = (60 * c + d) - (60 * a + b);
    e = delta / 60;
    f = delta % 60;
    printf("%d %d", e, f);
    return 0;
}

/*#include<cstdio>
using namespace std;
int main() {
    int a, b, c, d;
    scanf("%d%d%d", &a, &b, &c);
    d = a * 0.2 + b * 0.3 + c * 0.5;
    printf("%d", d);
    return 0;
}*/
#include<cstdio>
using namespace std;
int main() {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    printf("%d", a * 2 / 10 + b * 3 / 10 + c * 5 / 10);
    return 0;
}

#include<cstdio>
#include<cmath>
using namespace std;
int main() {
    int s, v;
    scanf("%d%d", &s, &v);
    int t_walk = ceil(1.0 * s / v) + 10;
    int from_zero = 60 * (24 + 8) - t_walk;
    int hh = (from_zero / 60) % 24;
    int mm = from_zero % 60;
    printf("%d:%d", hh, mm);
    return 0;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值