Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() //zad 7.
- {
- int dziala=1,i=0,x,tabl[100]={0},suma=0;
- while(dziala==1)
- {
- cout << "podaj liczbe: "<<endl;
- cin >> x;
- if (x>0)
- {
- tabl[i]=x;
- suma=suma+x;
- i++;
- }
- else
- {
- dziala=0;
- }
- }
- cout <<"wynik to: "<<suma<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement