Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6555 | 刘芃伽 | 数字反转 | C++ | Accepted | 0 MS | 268 KB | 810 | 2025-03-08 08:49:51 |
#include<iostream> // cin\cout\endl #include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; int main(){ int n,a,b,af,bf; cin>>n; while(n--){ cin>>a>>b; int t; t=a; af=0; while(t!=0){ af=af*10+t%10; t/=10; } t=b; bf=0; while(t!=0){ bf=bf*10+t%10; t/=10; } t=a+b; int abf=0; while(t!=0){ abf=abf*10+t%10; t/=10; } if(abf==af+bf) cout<<a+b; else cout<<"NO"; cout<<endl; } return 0; }