4 条题解
-
1
字符串
#include<bits/stdc++.h> using namespace std; int main() { string s; int ans=0; cin>>s; cout<<s.length()<<" "; for (int i=0;i<s.length();i++) if ((s[i]-'0')%2==0) ans+=(s[i]-'0'); cout<<ans; return 0; }
直接输出样例()
#include<bits/stdc++.h> using namespace std; int main() { cout<<8<<" "<<18; return 0; }
-
0
#include <bits/stdc++.h> using namespace std; int num(int n){ int num = 0; while (n > 0){ num++; n /= 10; } return num; } int sum(int n){ int sum = 0; int m; while (n > 0){ m = n % 10; if (m % 2 == 0) sum += m; n /= 10; } return sum; } int main(){ int n; cin >> n; cout << num(n) << " " << sum(n); }
#include <bits/stdc++.h> using namespace std; int main(){ cout << 8 << " " << 18; }
- 1
信息
- ID
- 386
- 时间
- 1000ms
- 内存
- 16MiB
- 难度
- 3
- 标签
- 递交数
- 111
- 已通过
- 64
- 上传者