#include<iostream>

int main(){
    int a,sum=0;
    
    while(true){
        std::cin>>a;
        
        if(a==0){
            break;
        }
        sum+=a;
    }
    std::cout<<"Sum ="<<sum;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: