Simple operation time limit for 16 binary: +Ms | Memory Limit:65535KB Difficulty:1
-
-
Describe
-
Now I'm going to give you a 16-in-a-plus-minus expression that requires the result of a 8-input expression.
-
-
Input
-
The
-
first line enters a positive integer T (0<t<100000)
Next there is t line, each line input a string s (length less than 15) string has two numbers and a plus or a minus, and the expression is legal and all operations are less than 31 bits
-
-
Output
-
-
Each expression output takes one row, and the result of the output expression 8 binary.
-
-
Sample input
-
-
329+482318be+67844ae1-3d6c
-
-
Sample output
-
-
441141001026565
Code:
#include <stdio.h> int main () {int T,x,y;char ch;scanf ("%d", &t), while (t--) {scanf ("%x%c%x", &x,&ch, &y), if (ch== ' + ') printf ("%o\n", x+y); elseprintf ("%o\n", X-y);} return 0;}
At first, the problem was complicated, and a string array was used to simulate the basic format type of the data to be converted!!!! The basic knowledge of C language is still need to strengthen!!!!
Simple operation of nyoj-244-16 binary