View Code of Problem 112

#include<iostream>
using namespace std;
int main()
{
	int n,sum,a;
	cin>>n;
	while(cin>>a&&a!=0&&n)
	{ 
	  
	   sum=sum+a;
	   n--;
	}
	cout<<sum<<endl;
	
 } 

Double click to view unformatted code.


Back to problem 112