求助 SPJ
  • 板块灌水区
  • 楼主ManGo_Mouse
  • 当前回复4
  • 已保存回复4
  • 发布时间2023/12/3 20:14
  • 上次更新2023/12/3 21:09:52
查看原帖
求助 SPJ
742907
ManGo_Mouse楼主2023/12/3 20:14

SPJ代码如下:

#include "testlib.h"
#include<bits/stdc++.h>
string key[10];
int main(int argc, char* argv[]) {
    registerTestlibCmd(argc, argv);
    long long uid = ouf.readLong();
    int a = ouf.readInt();
    int b = ouf.readInt();
    int c = ans.readInt();
    int d = ans.readInt();
    int num = ans.readInt();
	char need;

	for(int i = 2;i <= 10;i ++)
		key[1] += char((uid % i + uid % 14 + i * 3 / 2) % 65 + 'a');
	for(int i = 1;i <= 8;i ++)
		key[2] += char((uid * i) % 65 + ' ');
	for(int i = 1;i <= 8;i ++)
		key[3] += char((uid / i * 3 / i + i - i * 3 / 2) % 65 + 'A');
	for(int i = 1;i <= 8;i ++)
		key[4] += char((4 * i / 5 * 2 + 23 * i / 34 + 234 - 123) % 65 + '-');
	need = key[num][1];
	
    if(a == c && b == d)
        quitf(_ok, "%c",need);
    else
        quitf(_wa, "WA 掉了");
}

报错

/tmp/compiler_2jqp_0i4/src: In function ‘int main(int, char**)’:
/tmp/compiler_2jqp_0i4/src:15:9: 错误:‘string’ was not declared in this scope; did you mean ‘std::string’?
   15 |         string key[10];
      |         ^~~~~~
      |         std::string
2023/12/3 20:14
加载中...