Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46278 jiabokai 分成整数 C++ 通过 0 MS 252 KB 429 2024-05-03 09:05:34

Tests(1/1):


#include<bits/stdc++.h> using namespace std; bool judge(int n){ while(n>0){ int g=n%10; if(g==3||g==7){ return false; } n/=10; } return true; } int main() { int n,cnt; cin>>n; for(int i=1;i<n;i++){ for(int j=i+1;j<n;j++){ for(int k=j+1;k<n;k++){ if((judge(i)&&judge(j)&&judge(k))&&(i!=j&&j!=k&&i!=k)&&i+j+k==n){ cnt++; } } } } cout<<cnt; return 0; }


测评信息: