提交时间:2021-01-31 13:57:45

运行 ID: 10573

#include <iostream> using namespace std; int main() { int n, g, s, b, c=0; cin >> n; for(int i=103; i<=n*100+(n-1)*10+n-2; i+=2) { g = i%10; s = i/10%10; b = i/100; if(g!=s && s!=b && g!=b && g<=n && s<=n && b<=n) { c++; } } cout << c; return 0; }