1 #include<stdio.h> 2 int main() 3 { 4 int n; 5 scanf("%d",&n); 6 while(n--) 7 { 8 int a,b; 9 char s; 10 scanf("%x%c%x",&a,&s,&b); 11 if(s==‘+‘) 12 printf("%o\n",a+b); 13 else 14 printf("%o\n",a-b); 15 } 16 }
时间: 2024-12-09 12:36:02
1 #include<stdio.h> 2 int main() 3 { 4 int n; 5 scanf("%d",&n); 6 while(n--) 7 { 8 int a,b; 9 char s; 10 scanf("%x%c%x",&a,&s,&b); 11 if(s==‘+‘) 12 printf("%o\n",a+b); 13 else 14 printf("%o\n",a-b); 15 } 16 }