#include<stdio.h>
int main()
{
int a,b,s;
scanf("%d %d",&a,&b);
s=0;
while(!(b==-1))
{
s=a+b;
a=b;
scanf("%d",&b);
printf("%d",s);
if(b!=-1)
printf(" ");
if(b==-1)
printf("\n");
}
return 0;
}
int main()
{
int a,b,s;
scanf("%d %d",&a,&b);
s=0;
while(!(b==-1))
{
s=a+b;
a=b;
scanf("%d",&b);
printf("%d",s);
if(b!=-1)
printf(" ");
if(b==-1)
printf("\n");
}
return 0;
}
No comments:
Post a Comment