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.

26 tháng 3

#include <stdio.h>

int main(){

    int n;

    scanf("%d",&n);

    long t=0; int i,j;

    for (i=2; i<=n; i++){

        int c=0;

        for (j=2; j<i; j++)

            if (i%j==0) c++;

        if (c==0) t=t+i;

        }

printf("%d",t);

return 0;

}

9 tháng 1

Bạn trình bày lại đề bài rõ hơn nha, đề đọc rất khó hiểu ấy.

18 tháng 10 2021

Câu 3: 

#include <bits/stdc++.h>

using namepsace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

18 tháng 10 2021

Câu 3: 

#include <bits/stdc++.h>

using namepsace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

1:

#include <bits/stdc++.h>

using namespace std;

long long a,b;

int main()

{

cin>>a>>b;

cout<<a+b;

return 0;

}

2:

#include <bits/stdc++.h>

using namespace std;

double s,r;

int main()

{

cin>>r;

s=r*r*pi;

cout<<fixed<<setprecision(2)<<s;

return 0;

}

18 tháng 10 2021

Câu 3:

#include <bits/stdc++.h>

using namepsace std;

double a,b,c,p,s;

int main()

{

cin>>a>>b>>c;

p=(a+b+c)/2;

s=sqrt(p*(p-a)*(p-b)*(p-c));

cout<<fixed<<setprecision(2)<<s;

return 0;

}

25 tháng 4 2021

Làm giúp bài này nhé

 

25 tháng 4 2021

#include <bits/stdc++.h>
using namespace std;
long long n;
int main()
{
    freopen("fibonacci.inp","r",stdin);
    freopen("fibonacci.out","w",stdout);
    cin>>n;
    double c5=sqrt(5);
    cout<<fixed<<setprecision(0)<<((1/c5)*(pow((1+c5)/2,n)-pow((1-c5)/2,n)));
    return 0;
}

 

#include <bits/stdc++.h>

using namespace std;

long long n,i,s;

int main()

{

cin>>n;

s=0;

for (i=1; i<=n; i++) s=s+i*i;

cout<<s;

return 0;

}

19 tháng 1 2022

Var s,i,n:longint;

Begin

Write('Nhap so luong so n = ');readln(n);

For i:=1 to n do

s:=s+i*i;

Write('Tong la ',s);

Readln;

End.