Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
6561 | 邓小龙 | 数字反转 | C++ | Accepted | 0 MS | 260 KB | 800 | 2025-03-08 08:58:06 |
#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,a1,a2=0,b1,b2=0,t,x=0; cin>>n; while(n--){ cin>>a1>>b1; t=a1; a2=0; while(t!=0){ a2=a2*10+t%10; t/=10; } t=b1; b2=0; while(t!=0){ b2=b2*10+t%10; t/=10; } t=a1+b1; x=0; while(t!=0){ x=x*10+t%10; t/=10; } if(x==a2+b2) cout<<a1+b1; else cout<<"NO"; cout<<endl; } return 0; }