1 条题解

  • -1
    @ 2026-7-3 9:14:49
    using namespace std;
    
    int main() {
    	int a;
    	cin >> a;
    	if (a % 2 == 0) {
    		cout << "2" << endl;
    	}
    	if (a % 3 == 0) {
    		cout << "3" << endl;
    	}
    	if (a % 5 == 0) {
    		cout << "5" << endl;
    	}
    	if (a % 7 == 0) {
    		cout << "7" << endl;
    	}
    	return 0;
    }
    
    
    
    • 1

    【入门】请问一个整数n能够被2、3、5、7中哪些数整除

    信息

    ID
    30289
    时间
    1000ms
    内存
    256MiB
    难度
    2
    标签
    递交数
    33
    已通过
    23
    上传者