不对的

liyue  •  1个月前


include

using namespace std;

int main() {

int n;
cin>>n;
int max1=-1100000;
for(int i=1;i<=n;i++){
	int x;
	cin>>x;
	x=abs(x);
	double d=sqrt(x);
	int a=int(d);
	if(a==d){
		max1=max(max1,x);
	}

} cout<<max1; return 0; }

include

using namespace std;

int main() {

int n;
cin >> n;
for (int i = 1; i <= n; i++) {
	double x = sqrt(i);
	int h = int(x);
	if (x == h) {
		int y = i / 10 % 10;
		if (y % 2 == 1) {
			cout << i << "  ";
		}
	}
}
return 0;

}

include

using namespace std;

int main() {

int s, n;
cin >> s >> n;
int a = 0, b = 0, c = 0, d = 0, e = 0;
if (s == 100) {
	for (int i = 1; i <= n; i++) {
		int x;
		cin >> x;
		if (x >= 90)
			a++;
		else if (x >= 80)
			b++;
		else if (x >= 70)
			c++;
		else if (x >= 60)
			d++;
		else
			e++;
	}
} else
	for (int i = 1; i <= n; i++) {
		int x;
		cin >> x;
		if (x >= 130)
			a++;
		else if (x >= 110)
			b++;
		else if (x >= 100)
			c++;
		else if (x >= 90)
			d++;
		else
			e++;
	}
cout << a << "  " << b << "  " << c << "  " << d << "  " << e;
return 0;

}

include

using namespace std;

int main() {

int a = 100000;
int n;
cin >> n;
long long ans = 1;
if (n % 2 == 0) {
	if (n >= 50) {
		cout << 0 << endl;
	}
	for (int i = n; i >= 2; i -= 2)
		ans = (ans * i) % a;
} else {
	for (int i = n; i >= 1; i -= 2)
		ans = (ans * i) % a;
}
cout << ans << endl;
return 0;

}


评论:

请先登录,才能进行评论