K
Khách

Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.

15 tháng 2 2024

#include <bits/stdc++.h>
using namespace std;
int n,c;
long long a[10000];
bool iscp(long long m){
    return int(sqrt(m))*int(sqrt(m))==m;
}
int main()
{
    cin>>n;
    if(n==1){cout<<"0";return 0;}
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    for(int i=1;i<n;i++){
        for(int j=i+1;j<=n;j++){
            if(a[i]<=a[j]&&iscp(a[i])&&iscp(a[j])){
                c++;
            }
        }
    }
    cout<<c;
    return 0;
}

 

13 tháng 2 2024

Đề bài yêu cầu gì bạn nhỉ?

6 tháng 2 2024

567,468 -657,678=

6 tháng 2 2024

Ko Bt

 

6 tháng 2 2024

có thể làm ra một đoạn văn cho mình tham khảo dc ko?

29 tháng 2 2024

bằng số

6 tháng 2 2024

#include <bits/stdc++.h>

using namespace std;

int main(){

    int n;

    cin >> n;

    int a[n][n];

    for (int i=0; i<n;i++)

        for (int j=0;j<n;j++)

              a[i][j]=0;

    for (int i=0; i<n;i++){

        for (int j=0;j<n;j++)

              cout << a[i][j];

        cout <<endl;

     }

     return 0;

}

7 tháng 4 2025
n = int(input("Enter the size of the matrix: "))
# Initialize a 2D array with zeros a = [[0 for _ in range(n)] for _ in range(n)]
# Print the 2D array for row in a:     print(" ".join(map(str, row)))
7 tháng 4 2025

def generate_sequence(n):

"""Generates the sequence A up to the nth term."""


if n < 0:

return "Please enter a non-negative number."


sequence = [] # This list will hold our sequence


if n >= 0:

sequence.append(1) # A[0] = 1


if n >= 1:

sequence.append(3) # A[1] = 3


for i in range(2, n + 1):

# Calculate A[i] using the rule: A[i] = A[i-1] * 2 * A[i-2]

next_term = sequence[i - 1] * 2 * sequence[i - 2]

sequence.append(next_term)


return sequence


# Let's see the sequence up to the 5th term (A[0] to A[5])

result = generate_sequence(5)

print(result) # Output: [1, 3, 6, 36, 432, 31104]