HDU-1877(有一版 A+B)

来源:互联网 发布:数据分析师 招聘 西安 编辑:程序博客网 时间:2024/06/11 00:22
题目链接:https://vjudge.net/problem/HDU-1877
#include <iostream>#include <cstdio>using namespace std;typedef unsigned int ui;void DecToAny(ui n, int t){    if(n == 0) return;    DecToAny(n/t, t);    printf("%d", n%t);}int main(){    int m;    ui a, b;    while(scanf("%d", &m) != EOF && m)    {        scanf("%d%d", &a, &b);        if(a + b == 0) cout << 0;        else DecToAny(a+b, m);        cout << endl;    }    return 0;}
原创粉丝点击