16进制的简单运算
描述 現在給你一個16進制的加減法的表達式,要求用8進制輸出表達式的結果
?
輸出 每個表達式輸出占一行,輸出表達式8進制的結果 樣例輸入
3 29+4823 18be+6784 4ae1-3d6c樣例輸出
44114 100102 6565來源[路過這]原創上傳者 路過這
#include<stdio.h>
int main()
{
int test,a,b;
char ch;
scanf("%d", &test );
while(test--)
{
scanf("%x%c%x",&a,&ch,&b);
if(ch == '+')
printf("%o\n",a+b);
else
printf("%o\n",a-b);
}
return 0;
}
?
轉載于:https://www.cnblogs.com/leishitou/p/5436240.html
總結
- 上一篇: SQL Server资源管理之内存管理篇
- 下一篇: 解决IE下textarea不识别maxl