1 solutions

  • 0
    @ 2025-11-5 17:28:45

    C++ :

    #include<iostream>
    using namespace std;
    int a[10000];
    int main()
    {
    	int n,x,t=0;
    	cin>>n;
    	for (int i=1; i<=n; i++) cin>>a[i];
    	for (int i=1; i<=n; i++)	//第一个基因位置
    		if ((a[i]*a[i])%7==1)
    			{ x=i; break; }
    	for (int i=x+1; i<=n; i++) a[i-1]=a[i];
    	for (int i=1; i<n-1; i++) cout<<a[i]<<" ";
    	cout<<a[n-1]<<endl;
    	return 0;
    }
    
    • 1

    Information

    ID
    18470
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By