Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
128860 | 刘国洋 | 级数求和 | C++ | 解答错误 | 0 | 0 MS | 244 KB | 249 | 2024-01-26 10:49:25 |
#include<bits/stdc++.h> using namespace std; int ans = 0; int sym; int main() { int n; cin>>n; if(n < 0){ sym = -1; n=-n; } else{ sym = 1; } while(n != 0){ ans = ans * 10 + n % 10; n = n / 10; } cout << sym * ans; return 0; }