2 条题解

  • 1

    思路

    题目说了,是俩质数乘积,所以无需判断质数。

    code

    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int n;
    	scanf("%d",&n);
    	for(int i=2;i<n;i++){//从 2 枚举更快,因为因数在前面比较密集
    		if(n%i==0){
    			cout<<n/i;
    			return 0;
    		}
    	}
    	return 0;
    }
    
    • 0
      @ 2024-11-22 16:19:54

      #include<bits/stdc++.h> using namespace std; int main() { int b=0,a,n,x; cin>>n>>x; for(int i=1;i<=n;i++) { int t=i; a=t%10; while(t) { if(ax||tx) { b++; } t=t/10; }

      }
      cout<<b;
      return 0;
      

      }

      • 1

      信息

      ID
      444
      时间
      1000ms
      内存
      256MiB
      难度
      8
      标签
      递交数
      82
      已通过
      13
      上传者