UOJ Logo

NOI.AC

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#211995#3816. 元素chenchenCompile Error//C++356b2024-10-13 09:44:422024-10-13 12:10:37

answer

#include <iostream>
#include <cstring>
#include <algorithm>

using namespace std;

const int N = 2e3 + 10;

int n, q;
int a[N], b[N];

int main()
{
	scanf("%d%d", &n ,&q);
	for (int i = 1; i <= n; i ++ )
	{
		scanf("%d", &a[i]);
	}
	while (q -- )
	{
		int l, r;
		scanf("%d%d", &l, &r);
		printf("%d\n", r - l + 1);
	}
	return 0;
}

详细

answer.code: In function 'int main()':
answer.code:14:22: error: 'scanf' was not declared in this scope
  scanf("%d%d", &n ,&q);\x0d
                      ^
answer.code:23:27: error: 'printf' was not declared in this scope
   printf("%d\n", r - l + 1);\x0d
                           ^