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.

19 tháng 12 2021

#include <bits/stdc++.h>
using namespace std;
string st;
int d,i;
bool kt;
int main()
{
    cin>>st;
    d=st.length();
    kt=true;
    for (i=0; i<=d-1; i++)
        if ((st[i]!='6') and (st[i]!='8')) kt=false;
    if (kt==true) cout<<"YES";
    else cout<<"NO";
    return 0;
}

 

19 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long n,i,dem,t;

int main()

{

cin>>n;

dem=0;

t=0;

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

if (i%2==1) 

{

t=t+i;

dem++;

}

cout<<t<<" "<<dem;

return 0;

}

19 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long n,i,dem,t;

int main()

{

cin>>n;

dem=0;

t=0;

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

if (i%2==0) 

{

t=t+i;

dem++;

}

cout<<t<<" "<<dem;

return 0;

}

 

19 tháng 12 2021

Bài 2: 

#include <bits/stdc++.h>

using namespace std;

double r;

int main()

{

cin>>r;

cout<<2*r*pi<<endl;

cout<<r*r*pi;

return 0;

}

19 tháng 12 2021

 

 

#include <bits/stdc++.h>

using namespace std;

double a,b,c,tb;

int main()

{

cin>>a>>b>>c;

tb=(a+b+c)/3;

cout<<fixed<<setprecision(1)<<tb<<endl;

if (tb>=8) cout<<"Gioi";

else if ((6.5<=tb) and (tb<8)) cout<<"Kha";

else if ((5<=tb) and (tb<=6.5)) cout<<"Trung Binh";

else cout<<"Chua dat";

return 0;

}

12 tháng 12 2021

b:

#include <bits/stdc++.h>

using namespace std;

long long x,n,i,t;

int main()

{

cin>>n;

t=0;

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

{

cin>>x;

t=t+x;

}

cout<<fixed<<setprecision(2)<<t*1.0/(n*1.0);

return 0;

}

 

12 tháng 12 2021

#include <bits/stdc++.h>

using namespace std;

long long n,t;

int main()

{

cin>>n;

t=0;

while (n!=0) 

{

if ((n%3==0) or (n%5==0)) t=t+n;

cin>>n;

}

cout<<t;

return 0;

}

}