Zadatak72.

#include <iostream>

using namespace std;

int main()
{
int i,n,s,dj;
cout<<„Unesi broj stabala „;
cin>>n;
s=0;
for(i=1;i<=n;i++)
{
s=s+i;
}
dj=s/7;
if(dj%2==1)
cout<<dj<<“ „<<(s-(7*dj));
else
cout<<dj-1<<“ „<<(s-(7*(dj-1)))<<endl;
return 0;
}

Advertisements