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

Bài 33: Tính S(n) = CanBac2(2+CanBac2(2+….+CanBac2(2 + CanBac2(2)))) 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)

Tính S(n) = CanBac2(2+CanBac2(2+….+CanBac2(2 + CanBac2(2)))) có n dấu căn

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

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);

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

    getch();
    return 0;
}
Bạn thấy bài viết này như thế nào?: 
Average: 10 (3 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

 
TinyMCE

Cài đặt TinyMCE trong Drupal 7

This tutorial will show you how to install the TinyMCE editor into Drupal 7.

Hướng dẫn tăng like facebook số lượng lớn bằng Addmefast

Bạn vào mục ADD SITE/PAGE thên link mà bạn muốn tăng like hay gì cho nó.

Cách chèn Captions vào Drupal Images with jCaption

Cách chèn Captions vào Drupal Images with jCaption

jCaption allows you to add captions to your Drupal images, no matter what editor you're using.

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

 

Diet con trung