Bài 34: Tính S(n) = CanBac2(n+CanBac2(n – 1 + CanBac2( n – 2 + … + CanBac2(2 + CanBac2(1) có n dấu căn

Bài 34: Tính S(n) = CanBac2(n+CanBac2(n – 1 + CanBac2( n – 2 + … + CanBac2(2 + CanBac2(1) có n dấu căn

Bài tập 33 (Dạng bài tập này giúp các bạn giỏi về: Lưu đồ thuật toán)

Bài 34: Tính S(n) = CanBac2(n+CanBac2(n – 1 + CanBac2( n – 2 + … + CanBac2(2 + CanBac2(1) có n dấu căn

S(n) = n + n - 1 + n - 2 + ... 2 + 1

Cài đặt

#include<stdio.h>
#include<conio.h>
#include<math.h>
int main()
{
    int i, n;
    float S;
    do
    {
        printf("\nNhap n(n >= 1): ");
        scanf("%d", &n);

        if(n < 1)
        {
            printf("\nn phai >= 1. Xin nhap lai !");
        }
    }while(n < 1);

    i = 1;
    S = 0;

    while(i <= n)
    {
        S = sqrt(i + S);
        i++;
    }
    printf("\nTong S = %f", S);

    getch();
    return 0;
}
Bạn thấy bài viết này như thế nào?: 
Average: 3.9 (59 votes)
Ảnh của Tommy Tran

Tommy owner Express Magazine

Drupal Developer having 9+ year experience, implementation and having strong knowledge of technical specifications, workflow development. Ability to perform effectively and efficiently in team and individually. Always enthusiastic and interseted to study new technologies

  • Skype ID: tthanhthuy

Advertisement

 

jobsora

Dich vu khu trung tphcm

Dich vu diet chuot tphcm

Dich vu diet con trung

Quảng Cáo Bài Viết

 
The Best Video Player On Android–MoboPlayer

The Best Video Player On Android–MoboPlayer

MoboPlayer is the alternative video player to the default Android player. It is definitely the one app that will replace stock music application that you have been having on your Android phone.

Chiến lược tiếp cận khách hàng quanh cửa hàng của bạn chất nhất 2019

Chiến lược tiếp cận khách hàng quanh cửa hàng của bạn chất nhất 2019

Seach từ khóa Fanpage: Các địa điểm search trên Foody hoặc Google; Search từ khóa có địa điểm bạn cần

RDFa/Semantic Data có thể bridge Drupal và Non Drupal content

RDFa/Semantic Data có thể bridge Drupal và Non Drupal content

Search is a hard problem, it really is. Let me show this by using an example of a food chain that wants to add Drupal as their homepage of the whole chain.

Công ty diệt chuột T&C

 

Diet con trung