网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  PAT (Advanced Level) 1058. A+B in Hogwarts (20)

PAT (Advanced Level) 1058. A+B in Hogwarts (20)

分类: IT文章 • 2022-06-11 09:24:17

简单题。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;

int a1,b1,c1;
int a2,b2,c2;
int ans1,ans2,ans3;

int main()
{
  scanf("%d.%d.%d",&a1,&b1,&c1);
  scanf("%d.%d.%d",&a2,&b2,&c2);
  
  int k;
  ans3=(c1+c2)%29;
  k=(c1+c2)/29;
  
  ans2=(b1+b2+k)%17;
  k=(b1+b2+k)/17;
  
  ans1=(a1+a2+k);
  
  printf("%d.%d.%d
",ans1,ans2,ans3);
  return 0;
}

相关推荐

  • PAT (Advanced Level) 1019. General Palindromic Number (20)
  • PAT (Advanced Level) 1027. Colors in Mars (20)
  • PAT (Advanced Level) 1023. Have Fun with Numbers (20)
  • PAT (Advanced Level) 1031. Hello World for U (20)
  • pat1058. A+B in Hogwarts (20) 1058. A+B in Hogwarts (20)
  • PAT (Advanced Level) Practice 1116 Come on! Let's C (20分) 1.题目 2.代码
  • PAT (Advanced Level) Practice 1112 Stucked Keyboard (20分) (基础不扎实的后果) 1.题目 2.题目分析  3.代码
  • PAT (Basic Level) Practice (中文)1022 D进制的A+B (20 分)
  • PAT (Advanced Level) Practice 1019 General Palindromic Number (20 分) (进制转换,回文数)
  • PAT (Advanced Level) Practice 1152 Google Recruitment (20 分)
  • PAT (Advanced Level) 1060. Are They Equal (25)
  • PAT (Advanced Level) 1057. Stack (30)
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号