terça-feira, 10 de março de 2009

Desafio 1

Elabore um programa que leia um vetorA e um VetorB de 20 elementos do tipo real, construa um VetorC de mesma dimensão com o resultado da média do VetorA com o VetorB.

18 comentários:

  1. Este comentário foi removido pelo autor.

    ResponderExcluir
  2. Este comentário foi removido pelo autor.

    ResponderExcluir
  3. Program ex_hightech ;
    usescrt;
    type
    vetorA=array [1..20] of real;
    vetorB=array [1..20] of real;
    vetorC=array [1..20] of real;
    var
    A:vetorA;
    B:vetorB;
    C:vetorC;
    I:integer;
    Begin
    usescrt
    for I:=1 to 20 do
    begin
    gotoxy(10,5);
    writeln('Vetor A');
    gotoxy(10,5+I);
    readln(A[I]);
    gotoxy(30,5);
    writeln('Vetor B');
    gotoxy(30,5+I);
    readln(B[I]);
    C[I]:= (A[I] + B[I])/2;
    gotoxy(50,5);
    writeln('Vetor C');
    gotoxy(50,5+I);
    writeln(C[I]:2:2);
    end;

    End.

    ResponderExcluir
  4. Gilberson do Valle

    program elementos;
    uses crt;
    type
    vetorA=array[1..20] of real;
    vetorB=array[1..20] of real;
    vetorC=array[1..20]of real;
    var
    I:INTEGER;
    A:vetorA;
    B:vetorB;
    C:vetorC;
    media:real;
    Begin
    textbackground(1);
    textcolor(0);
    clrscr;
    For I:=1 to 20 do
    begin
    writeln('escreva o valor a[i]');
    readln(a[i]);
    writeln('escreva o valor b[i]');
    readln(b[i]);
    end;
    For I:=1 to 20 do
    begin
    c[i]:=a[i]+b[i];
    end;
    media:=c[i]/20;
    writeln('a media é',c[i]:2:2);
    readln;
    readln;
    end.

    ResponderExcluir
  5. Sinara do Valle

    program elementos;
    uses crt;
    type
    vetorA=array[1..20] of real;
    vetorB=array[1..20] of real;
    vetorC=array[1..20]of real;
    var
    I:INTEGER;
    A:vetorA;
    B:vetorB;
    C:vetorC;
    media:real;
    Begin
    textbackground(0);
    textcolor(6);
    clrscr;
    For I:=1 to 20 do
    begin
    writeln('digite o valor a[i]');
    readln(a[i]);
    writeln('digite o valor b[i]');
    readln(b[i]);
    end;
    For I:=1 to 20 do
    begin
    c[i]:=a[i]+b[i];
    end;
    media:=c[i]/20;
    writeln('a media é',c[i]:2:2);
    readln;
    readln;
    end.

    ResponderExcluir
  6. Taffarel Ribeiro.

    Program media_ex1 ;

    type
    vetorA = array [1..20] of real;
    vetorB = array [1..20] of real;
    vetorC = array [1..20] of real;
    var
    A:vetorA;
    B:vetorB;
    C:vetorC;
    I:integer;
    Begin

    for I:= 1 to 20 do
    begin
    readln(A[I]);
    readln(B[I]);
    end;
    for I:= 1 to 20 do
    begin
    C[I]:= (A[I] + B[I])/ I;
    writeln(C[I]);
    end;

    End.

    ResponderExcluir
  7. Bianca Nunes
    Program vetor;
    Type
    vetorA=array [1..20] of real;
    vetorB=array [1..20] of real;
    vetorC=array [1..20] of real;

    Var
    I:integer;
    A: A;
    B:B;
    C:C;
    Begin
    For I :=1 to 20 do
    Begin
    writeln('Digite vetor A');
    Readln(A[I]);
    End;
    For I:= 1 to 20 do
    Begin
    Writeln('Digite vetor B');
    Readln(B[I]);
    End;
    For I:= 1 to 20 do
    Begin
    C[I] :=(A[I] +B[I]) /2;
    Writeln('A media e', C [I]:2:2);
    End;
    Readln;
    End.

    ResponderExcluir
  8. Daniella
    Program vetor;
    Type
    vetorA=array [1..20] of real;
    vetorB=array [1..20] of real;
    vetorC=array [1..20] of real;

    Var
    I:integer;
    A: A;
    B:B;
    C:C;
    Begin
    For I :=1 to 20 do
    Begin
    writeln('Digite vetor A');
    Readln(A[I]);
    End;
    For I:= 1 to 20 do
    Begin
    Writeln('Digite vetor B');
    Readln(B[I]);
    End;
    For I:= 1 to 20 do
    Begin
    C[I] :=(A[I] +B[I]) /2;
    Writeln('A media e', C [I]:2:2);
    End;
    Readln;
    End.

    ResponderExcluir
  9. Isadora
    Program vetor;
    Type
    vetorA=array [1..20] of real;
    vetorB=array [1..20] of real;
    vetorC=array [1..20] of real;

    Var
    I:integer;
    A: A;
    B:B;
    C:C;
    Begin
    For I :=1 to 20 do
    Begin
    writeln('Digite vetor A');
    Readln(A[I]);
    End;
    For I:= 1 to 20 do
    Begin
    Writeln('Digite vetor B');
    Readln(B[I]);
    End;
    For I:= 1 to 20 do
    Begin
    C[I] :=(A[I] +B[I]) /2;
    Writeln('A media e', C [I]:2:2);
    End;
    Readln;
    End.

    ResponderExcluir
  10. :Gabriel:

    Program V3;
    Uses crt;
    Type

    vetorA=array [1..20] of real;
    vetorB=array [1..20] of real;
    vetorC=array [1..20] of real;

    var

    A:vetorA;
    B:vetorB;
    C:vetorC;
    I:integer;

    Begin
    for I:=1 to 20 do
    begin
    writeln('Digite Vetor A');
    readln(A[I]);
    writeln('Digite Vetor B');
    readln(B[I]);
    C[I]:= (A[I] + B[I])/2;
    writeln('Vetor C');
    writeln(C[I]:2:2);
    end;

    End.

    ResponderExcluir
  11. Beleza, agora já conseguimos adicionar comentários!!!!

    ResponderExcluir
  12. Este comentário foi removido pelo autor.

    ResponderExcluir
  13. Mateus Dalcol

    Program ExercicioHitech;
    Uses crt;
    Type
    vetorA=array [1..20] of real;
    vetorB=array [1..20] of real;
    vetorC=array [1..20] of real;

    var
    A:vetorA;
    B:vetorB;
    C:vetorC;
    I:integer;

    Begin
    textcolor(5);
    Textbackground(1);
    for I:=1 to 20 do
    begin
    writeln('Digite Vetor A');
    readln(A[I]);
    writeln('Digite Vetor B');
    readln(B[I]);
    C[I]:= (A[I] + B[I])/2;
    writeln('A media e', C[I]:2:2);
    end;
    End.

    ResponderExcluir
  14. Renato
    Program diadyu;
    uses crt;
    type
    vetorA=array[1..20]of real;
    vetorB=array[1..20]of real;
    vetorC=array[1..20]of real;
    var
    A:vetorA;
    B:vetorB;
    c:vetorC;
    I:integer;
    begin
    textbackground(8);
    textcolor(3);
    clrscr;
    forI:= 1 to 20 do
    begin
    gotoxy(10,4+I);
    readln(A[I]);
    gotoxy(20,4+I);
    readln(B[I]);
    C[I]:=(A[I])+(B[I])/2
    gotoxy(30,4+I);
    writeln(C[I]:2:2);
    end;
    readln;
    end.

    ResponderExcluir
  15. Isso ai galera as respostas estão todas certas,parabénsssssssssss
    Grupo High tech

    ResponderExcluir
  16. Oi Grupo highTech, vcs conferiram a resposta deste comentário?
    http://grupohightech.blogspot.com/2009/03/desafio-2.html?showComment=1237167960000#c4953978545483593262

    ResponderExcluir
  17. http://grupohightech.blogspot.com/2009/03/desafio-2.html?showComment=1237167960000#c4953978545483593262

    ResponderExcluir
  18. Este comentário é apenas um este no blog de vcs.

    Desculpem o transtorno

    ResponderExcluir