Facebook
From Burly Goat, 7 Years ago, written in C++.
Embed
Download Paste or View Raw
Hits: 274
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int liczby[5];
  8.  
  9.     cout<<"podaj piec liczb calkowitych"<<endl;
  10.     for(int i=0;i<5;i++)
  11.     {
  12.         cin>>liczby[i];
  13.     }
  14.     cout<<"wprowadzone liczby"<<endl;
  15.      for(int j=0;j<5;j++)
  16.     {
  17.         cout<<liczby[j] << " ";
  18.     }
  19.  
  20.     int suma=0;
  21.     for(int k=0;k<5;k++)
  22.     {
  23.         suma += liczby[k];
  24.     }
  25.     cout<<"suma:"<<suma<<endl;
  26.  
  27. }
  28.