[HackerRank] Easy
A Very Big Sum
- Similar with Simple Array Sum
- Scan the input about how many integers which we will input
- Make the array to put the big number (use the long)
- Put the inputs to the list
- Because i is the big integer, we should use the %li
- Print out the sum
Diagonal Difference
- Scan the input and make the matrix
- Scan the input which should be put inside to matrix
- Because the matrix has the row and column, we should use the double for loop
- Calculate the first case, which the i and j has the same number
- wrong in the picture, the row and column should be [0][0],[1][1],[2][2]
- Calculate the second case, in this case, j has the [2][2],[1][1],[0][0]
- use the abs() function to calculate the difference between two summation
Plus Minus
- scan the number of input
- the number of positive, negative, zero should be calculated by float
- use the float
- input the integer to the array
- use the if function to calculate the number of positive, negative, and zero
- use the %f to print out the float
'CSS 동아리_ > [HackerRank]' 카테고리의 다른 글
[HackerRank] 2019.05.20-2019.05.26 (0) | 2019.05.30 |
---|---|
[HackerRank] Easy (0) | 2019.05.12 |