VCT tính P = An * Xn + An-1 * Xn-1 + ... + A1 * X + A0

VCT tính P = An * Xn + An-1 * Xn-1 + ... + A1 * X + A0

VCT tính P = An * Xn + An-1 * Xn-1 + ... + A1 * X + A0

Đáp án

program luythua;

Uses Crt;
Type Mang = ARRAY[1..50] Of Integer;
Var A:Mang;
 N,i, j,x, k, Sum:Integer;

function luythua(x,n: integer) : longint;

var i: integer; T:longint;

begin

    T:=1;

    for i:= 1 to n do T:=T*x;

    luythua :=T;

end;
    
    
Begin
    {Nhap mang}
    Write('Nhap N='); Readln(N);
    For i:=1 To N Do
        Begin
            Write('A[',i,']='); Readln(A[i]);
        End;
    
    {Nhap X}
    write ('Nhap x='); readln (x);    

    {tong day so}    
    Sum:= 0;
    For k:=N + 1 downto i Do
        Sum := Sum + (A[k] * luythua(x, k));
        
    {In kết quả ra màn hình}
    Writeln('Tong cua day so: ', Sum);

    Readln;
 
 End.

Hình minh họa

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

Bình luận (0)

 

Add Comment

Filtered HTML

  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Các thẻ HTML được chấp nhận: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Tự động ngắt dòng và đoạn văn.

Plain text

  • No HTML tags allowed.
  • Các địa chỉ web và email sẽ tự động được chuyển sang dạng liên kết.
  • Tự động ngắt dòng và đoạn văn.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

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

 
Sử dụng field trong Drupal: Inline Entity Form Vs Field Collection

Sử dụng field trong Drupal: Inline Entity Form Vs Field Collection

In this example I'll be adding a page with the ability to add a list of pets. The available fields will be the pet name, image, type (term reference) and a long text description field.

CasperJS

Hướng dẫn testing Drupal data migrations với CasperJS

On a recent project, the source data is anything but consistent, so while a manual review of one migrated item might look correct, any number of other items could have problems

Hướng dẫn Debug: Stop Thinking and Look năm 2015

Hướng dẫn Debug: Stop Thinking and Look năm 2015

Debugging is a discipline that requires patience, and a fervent attention to detail. 

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

 

Diet con trung