You are on page 1of 1

Zadanie 15

#include <iostream>

using namespace std;

string koniec;

int main()

do{

float i=0, x, suma=0, a;

cout << "Podaj ilosc danych" << endl;

cin >> x;

cout << "Podaj liczbe" << endl;

cin >> a;

suma=(1/a);

for(i=1; i<x; i++)

cout << "Podaj kolejna liczbe" << endl;

cin >> a;

suma+=(1/a);

cout << "Suma wynosi: " << suma << endl;

cout << "Konczymy na dzis? t-tak" << endl;

cout << "Inny klawisz uruchomi ponownie program" << endl;

cin >> koniec;

}while(koniec!="t");

return 0;

You might also like