啊!!!我要疯了!
查看原帖
啊!!!我要疯了!
709026
HuangWenJun123楼主2022/7/17 22:27
#include <bits/stdc++.h>

using namespace std;

const int maxn=100005;

long long a[maxn];

long long shu,ans=0;

char fuhao;

long long i=0;

int main()

{   

    i++;

    cin>>a[i];

   // cout<<a[i];

    a[i]%=10000;

    while(cin>>fuhao>>shu) 

    {

        //cout<<fuhao<<shu;

        shu%=10000;

        //cout <<shu<< endl;

        if(fuhao='+')

        {

            i++;

            a[i]=shu;

        }

        else

        {

            a[i]=(a[i-1]*shu)%10000;

        }

        //cout << i << endl;

    }

    //cout << i << endl;

    //for(int k=1;k<=i;k++)

    //{

       // cout<<a[k]<<endl<<k<<endl;

	  // }

    for(int k=1;k<=i;k++)

    {

        ans+=a[k];

        ans%=10000;

	   }

	   cout<<ans;

    return 0;

}

求大佬 我要改的累死了

2022/7/17 22:27
加载中...