Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
1607 A班-过懿萱 连续递增或递减数 C++ 通过 100 0 MS 264 KB 426 2024-12-07 10:59:15

Tests(2/2):


#include <bits/stdc++.h> using namespace std; int main() { int n,temp = 0,count = 0; cin>>n; for(int i = 100;i <= n;i++) { int bai,shi,ge; bai = i / 100; shi = i / 10 % 10; ge = i % 10; if(bai < shi && shi < ge || bai > shi && shi > ge) { temp++; count += i; } } cout<<count<<" "<<temp; return 0; }


测评信息: