提交时间:2021-02-21 13:33:04

运行 ID: 10928

#include <iostream>//首先定义变量,再运用for循环组织搭配 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)//for循环 { 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;//for循环 return 0; }