Advertisement
joaopaulofcc

Untitled

Aug 19th, 2020
1,043
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 0.43 KB | None | 0 0
  1. import 'dart:io';
  2.  
  3. void main()
  4. {
  5.   const qtdNum = 6;
  6.  
  7.   List A = [];
  8.   int num, soma;
  9.  
  10.   for(int i = 1; i <= qtdNum; i++)
  11.   {
  12.     print("Digite o $iº número: ");
  13.     num = int.parse(stdin.readLineSync());
  14.     A.add(num);
  15.   }
  16.  
  17.   soma = A[0] + A[1] + A[5];
  18.   print("\nSoma das posições 0, 1 e 5: $soma");
  19.  
  20.   A[4] = 100;  
  21.  
  22.   print("\nImprimindo a lista");
  23.  
  24.   A.forEach((numero)
  25.   {
  26.     print(numero);
  27.   });
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement