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