当前位置:网站首页>1058 a+b in Hogwarts (20 points)
1058 a+b in Hogwarts (20 points)
2022-06-30 14:55:00 【Xue Dongjing】
1058 A+B in Hogwarts (20 branch )
The question
Give two numbers A,B, The format of the number is x1.x2.x3. among x3 This is Feng 29 Go to x2 Into one ,x2 Is every 17 Go to x1 Into one .(x1,x2,x3 They are all numbers in decimal system ). seek A+B.
Ideas
Direct addition , Each bit determines whether to carry . Pay attention to the input format .
Code
#include<stdio.h>
int main()
{
int A1,A2,A3,B1,B2,B3,C1,C2,C3,carry=0,x;
scanf("%d.%d.%d",&A1,&A2,&A3);
scanf("%d.%d.%d",&B1,&B2,&B3);
x=A3+B3;
carry=x/29;
C3=x%29;
x=A2+B2+carry;
carry=x/17;
C2=x%17;
C1=A1+B1+carry;
printf("%d.%d.%d\n",C1,C2,C3);
return 0;
}
边栏推荐
- Maximum area of islands searched
- [extensive reading of papers] sentimental analysis of online reviews with a hierarchical attention network
- Matlab judges the number of same purchases
- Lfi-rce without controllable documents
- 这种零件该怎么编程加工?
- How to use Alibaba Vector Icon
- jsPlumb. Deleteeveryconnection is not a function & jsplumb clear canvas jsplumb delete all nodes and all connections
- 先锋期货安全么?现在期货开户都是哪些流程?期货手续费怎么降低?
- [buuctf] [actf2020 freshman competition]exec1
- The kth largest element in the sorted array
猜你喜欢
![[extensive reading of papers] multimodal attribute extraction](/img/ec/546c107ac0d31deded7ca94fdf0e2d.jpg)
[extensive reading of papers] multimodal attribute extraction

Error $(...) size is not a function

val_ Loss decreases first and then increases or does not decrease but only increases

How to realize selective screen recording for EV screen recording
![【BUUCTF】[GXYCTF2019]Ping Ping Ping1](/img/dc/4d87dfb0c2fa9cd75b54e092fd3971.jpg)
【BUUCTF】[GXYCTF2019]Ping Ping Ping1

day02

ThinkPHP v3.2 comment annotation injection write shell

2021-07-14 mybaitsplus

【BUUCTF】 EasySql

How does hbuilder display in columns?
随机推荐
1 figure to explain the difference and connection between nodejs and JS
Invalid argument during startup: Failed to open the . conf file: redis-window
Determine the number of digits of an integer in MATLAB (one line of code)
Win10 backup backup shows that creating a shared protection point on the shadow failed
Matlab finds prime numbers within 100
CCF drawing (full mark code + problem solving ideas + skill summary) February 2, 2014
CCF call auction (full mark code + problem solving ideas + skill summary) 201412 - 3
Finding the root of an integer by dichotomy
Sum of CCF digits (full mark code + problem solving idea) 201512-1
August 24, 2021 deque queue and stack
Svn password forgetting solution
[extensive reading of papers] multi modal sarcasm detection and human classification in code mixed conversations
Greedy two-dimensional array sorting
Querywrapper in mybaits plus
Lost connection to the flow server (0 retries remaining): |Out of retries, exiting! Error reporting solution (flow)
Location of dichotomy
1133: output family and friends string
Is it troublesome for CITIC futures to open an account? Is it safe? How much is the handling charge for opening an account for futures? Can you offer a discount
数控加工中心打刀缸工作原理及故障处理
JS array sorting method summary