Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97286 | Kevin | 15几个数字组成 | C++ | Accepted | 1 MS | 276 KB | 266 | 2024-11-12 15:09:56 |
#include<bits/stdc++.h> using namespace std; int main(){ long long n,s=0; cin>>n; if(n>0){ while(n>0){ s++; n/=10; } cout<<s; } else if(n<0){ n*=-1; while(n>0){ s++; n/=10; } cout<<s; } else cout<<1; return 0; }