@digits (integer, fraction)


Reverses the digits of an integer mathmatically


//Demonstrates the use of a do loopimport java.util.Scanner;public class ReverseNumber {public static void main(String []args){int number,lastDigit,reverse=0;Scanner scan=new Sc...

2013/05/03 00:00

Number of Digits in an Integer in Java


1. Introduction In this quick tutorial, we'll explore different ways of getting the number of digits in an Integer in Java. We'll also analyze those different methods and will f...

2020/01/29 00:00

Fraction Calculation


This App is a simple but functional Fraction Calculator also a Fraction Input Tool. it provides multiple fraction calculators capable of addition, subtraction, multiplication, d...

2019/04/17 00:00

poj 1930 Dead Fraction


Description Mike is frantically scrambling to finish his thesis at the last minute. He needs to assemble all his research notes into vaguely coherent form in the next 3 days. Un...

2018/08/13 00:00

[agc003F]Fraction of Fractal


Description 传送门 Solution 本篇博客思路来自大佬的博客(侵删)。 我们定义如果网格的第一行和最后一行的第i列都为黑色,则它是一个上下界接口。左右界接口定义同上。 如果上下界接口和左...

2018/08/16 00:00

【AGC003F】Fraction of Fractal


Description      原题链接       Solution      神题。     定义一个上边界或下边界的格子为”上下接口“,当且仅当上下边界该位置的格子都是黑色的。     ”左右接口...

2018/08/16 00:00



02/02 00:00

8504. Sum of Digits


Sum of Digits   Having watched the last Harry Potter film, little Gerald also decided to practice magic. He found in his father's magical book a spell that turns any number in...

2018/11/17 00:00

【Leetcode】258.Add Digits


` /** Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. * For example: * Given num = 38, the process is like: 3 + 8 = 11, 1 + ...

[AGC003]F - Fraction of Fractal


Time limit : 2sec / Memory limit : 256MB Problem Statement Snuke got a grid from his mother, as a birthday present. The grid has $H$ rows and $W$ columns. Each cell is painted b...

2018/01/29 00:00



重载>> 和 << #include // 或 #include using std::istream;using std::ostream; friend istream& operator>> (istream& , Myclass& );friend ostream& operator<< (ostream& , const Mycla...

2019/04/11 00:00

Add Digits(leetcode258)


Given a non-negative integer num, repeatedly add all its digits until the result has only one digit. Example: Input: 38 Output: 2 Explanation: The process is like: 3 + 8 = 11, 1...

2018/12/11 00:00

leetcode- Add Digits


Given a non-negative integer , repeatedly add all its digits until the result has only one digit. For example: Given , the process is like: , . Since has only one digit, return ...

2016/08/03 00:00

CF1209C Paint the Digits


You are given a sequence of n digits d1d2…dn. You need to paint all the digits in two colors so that: each digit is painted either in the color 1 or in the color 2; if you wri...

2019/09/15 00:00

F - Fraction Formula Gym - 102307F


Mr. Potato Head has been promoted and now is a math professor at the UNAL. For his first course he is willing to teach hard subjects, so at the moment he is teaching how to add ...

2019/09/13 00:00

G - Infinite Fraction Path HDU - 6223


The ant Welly now dedicates himself to urban infrastructure. He came to the kingdom of numbers and solicited an audience with the king. He recounted how he had built a happy pat...

2018/10/13 00:00

【java】Integer == Integer?


Integer a = 1;Integer b = 1;Integer c = 128;Integer d = 128;System.out.println(a == b); //trueSystem.out.println(c == d); //false 原因: Integer里弄了一个缓存,对于在 -128—127...

2015/07/26 00:00

CF997B Roman Digits


题意翻译 给你一棵树,每次挑选这棵树的两个叶子,加上他们之间的边数(距离),然后将其中一个点去掉,问你边数(距离)之和最大可以是多少. 题目描述 You are given an unweighted tree with n n ...

2018/07/26 00:00

[kata] Playing with digits


package kata_011; /** Some numbers have funny properties. For example: * 89 --> 8¹ + 9² = 89 * 1 * 695 --> 6² + 9³ + 5⁴= 1390 = 695 * 2 * 46288 --> 4³ + 6⁴+ 2⁵ + 8⁶ + ...

2018/08/28 00:00

实现分数的加减 Fraction Addition and Subtraction


问题: Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result should be irr...

2018/01/11 00:00