QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#182901 | #6750. Calculate | Kewu | Compile Error | / | / | C++14 | 553b | 2023-09-18 18:46:02 | 2023-09-18 18:46:02 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N=5e3+10;
char Map[N];
int main()
{
gets(Map+1);int n=strlen(Map+1);
int ans=0;
for(int i=1;i<=n;++i)
{
if(Map[i]!='?'&&(Map[i]<'0'||Map[i]>'9')) continue;
int flag=1;
for(int j=1;j<i;++j)
if(Map[j]=='-') flag=-flag;
if(Map[i]=='?')
{
if(flag==1)
ans+=9;
}
else ans+=flag*(Map[i]-'0');
}
cout<<ans<<endl;
// system("pause");
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:10:5: error: ‘gets’ was not declared in this scope; did you mean ‘getw’? 10 | gets(Map+1);int n=strlen(Map+1); | ^~~~ | getw