Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
106667 李昊宇 各个位数之和 C++ Time Limit Exceeded 1000 MS 264 KB 209 2025-01-16 14:46:30

Tests(0/5):


Code:

#include<iostream> using namespace std; int main(){ int a,b=0; cin>>a; if(a<0){ a=a*-1; } while(a>0){ a=a%10; b=b+a; } cout<<b; return 0; }